Exception without proper message if there is no :db role in application
message:
cap aborted!
undefined method `roles_array' for nil:NilClass
Tasks: TOP => whenever:update_crontab
(See full trace by running task with --trace)
The deploy has failed with an error: #<NoMethodError: undefined method `roles_array' for nil:NilClass>
The problem is because there is no host here:
def setup_whenever_task(*args, &block)
args = Array(fetch(:whenever_command)) + args
on roles fetch(:whenever_roles) do |host|
Having the same issue here. Had to put a role in my whenever_roles that did match some hosts, although no scheduled job actually has this role.
We're also experiencing this issue, so workaround for now is to add the the whenever_roles like what @fpbouchard mentioned
Also faced this issue. Im my case it manifested when I use HOSTS to target cap deploys to hosts that don't match the whenever role.
Submitted the PR above.
Not sure if it's the most elegant solution but got my deployments working.
I'm also experiencing this when specifying HOSTS as @mhfs mentioned. Is there a better workaround?
I'm running into this as well. I am trying to deploy to staging (where no hosts match the :db role), and it's complaining because no hosts are found. Any help? The PR above seems like it would work, but it was closed without comment also.
I just tried version 0.9.4 and it still has the same issue. Any chance this can be addressed?