whenever icon indicating copy to clipboard operation
whenever copied to clipboard

Exception without proper message if there is no :db role in application

Open alexander-bal opened this issue 12 years ago • 6 comments

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|

alexander-bal avatar Mar 23 '14 19:03 alexander-bal

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.

fpbouchard avatar Apr 01 '14 18:04 fpbouchard

We're also experiencing this issue, so workaround for now is to add the the whenever_roles like what @fpbouchard mentioned

khangtoh avatar Apr 07 '14 11:04 khangtoh

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.

mhfs avatar Apr 11 '14 16:04 mhfs

I'm also experiencing this when specifying HOSTS as @mhfs mentioned. Is there a better workaround?

mwalsher avatar Nov 10 '15 18:11 mwalsher

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.

timcheadle avatar Dec 09 '15 18:12 timcheadle

I just tried version 0.9.4 and it still has the same issue. Any chance this can be addressed?

timcheadle avatar Jan 20 '16 19:01 timcheadle