javan / javan/whenever

Schedule deployment fails when user doesn't yet have a crontab

Open
#517 5 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

I added these lines to deploy.rb as instructed.
set :whenever_command, "bundle exec whenever"
require "bundler/capistrano"
require "whenever/capistrano"

I got the following error when I tried to run cap deploy. Any ideas? My schedule.rb is commented out so it is not that. My ruby is 2.1.3 and rails is 4.1.8. This happens when it executes `whenever:update_crontab'.

** [out :: mydomain] /path/to/app/shared/bundle/ruby/2.1.0/gems/whenever-0.9.4/lib/whenever/command_line.rb:77:in `write_crontab':
** [out :: mydomain] undefined method `zero?' for nil:NilClass (NoMethodError)
** [out :: mydomain] from /path/to/app/shared/bundle/ruby/2.1.0/gems/whenever-0.9.4/lib/whenever/command_line.rb:35:in `run

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

Start in whenever/command_line.rb at the reported write_crontab failure and trace the whenever:update_crontab path when the remote user has no crontab. Reproduce the deployment scenario with an empty crontab, then verify the command completes successfully and preserves the expected schedule output.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.