Postgres "relation "myschema.MyTableName" does not exist
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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