5.2.2 Jobs Not Running with job_type :runner
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 8.9k
- Forks
- 715
- PR merge metrics
- No merged PRs in 30d
Description
I had an issue after upgrading to 5.2.2 when jobs where not running. Jobs were added to crontab correctly and looked correct. I compared it to the crontab that worked before and it was the same. The issue was that the method to run the job was no longer working. I used a new job_type to use new commands and resolve the issue. The problem is that && bundle exec bin/rails needed to drop the "bin" and just read && bundle exec rails. I'm not sure if anyone else has had or can recreate the issue.
Just to confirm, the only changes made to my environment when this occurred was upgrading from Rails 5.0.1 to Rails 5.2.2.
Doesn't Work:
Default - job_type :runner, "cd :path && bin/rails runner -e :environment ':task' :output"
Creates this cronjob -
/bin/bash -l -c 'cd /var/deploy/MyApp/web_head/releases/20190201171815 && bundle exec bin/rails runner -e staging '\'MyJob.perform_now'\'''
Working Version:
My Custom job_type - job_type :new_runner, "cd :path && bundle exec rails runner -e :environment ':task' :output"
Creates this cronjob -
/bin/bash -l -c 'cd /var/deploy/MyApp/web_head/releases/20190201194724 && bundle exec rails runner -e staging '\''MyJob.perform_now'\'''
My environment is Ubuntu 16.04 self hosted but managed through Cloud66.
- ruby 2.4.2p198
- Rails 5.2.2
And thank you to the creators/maintainers of this awesome gem. Also, the ability to create a custom job_type made this issue very minor, so thank you for that as well.
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
Start with the default :runner job_type and the generated cron command shown in the report, comparing the failing bundle exec bin/rails form with the working bundle exec rails form. Reproduce the behavior across the reported Rails versions and add a regression test if the issue is confirmed; done means the default runner command executes jobs correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, rails, ruby
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100