Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
divineforest opened this issue Mar 23, 2014 · 6 comments
Closed

Comments

@divineforest
Copy link

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|
@fpbouchard
Copy link

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.

@khangtoh
Copy link

khangtoh commented Apr 7, 2014

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

@mhfs
Copy link

mhfs commented Apr 11, 2014

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.

@javan javan closed this as completed Jun 29, 2014
@mwalsher
Copy link

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

@timcheadle
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants