javan / javan/whenever

Postgres "relation "myschema.MyTableName" does not exist

Open
#543 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

awaiting-feedback bugfix
Dominant language
Ruby
Stars
8.9k
Forks
715
PR merge metrics
No merged PRs in 30d

Description

Hi,

in schedule.rb i have the following:

  set :output, "cron_log.log"
  set :job_template, "bash -i -c ':job'"
  env :PATH, ENV['PATH']

and

every 1.minutes do
  runner "MyController.new.MyAction", :environment => 'development'
end

in both databases Production and development i have the table and if i execute the same query i get the result.
If i take the entry from crontab and execute it in terminal i get the desired Action call, but if cron job tries to execute it it gets:

PG::UndefinedTable: ERROR:  relation "mySchema.MaTableName" does not exist

do you have any suggestions?

regards Ivan

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with schedule.rb and the generated crontab entry; compare the environment and command when cron runs with the same command in a terminal. Reproduce the PG::UndefinedTable failure and determine what configuration or invocation change makes the existing relation available; done means the scheduled action completes without the missing-relation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, ruby
Domain
cli, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.