Skip to content
This repository has been archived by the owner on Feb 22, 2021. It is now read-only.

[Chef 12.0] Cannot find a provider for deploy_revision[application] on ubuntu version 12.04 #53

Closed
marcoamorales opened this issue Dec 9, 2014 · 26 comments

Comments

@marcoamorales
Copy link

This looks to be related with the changes in Chef 12 regarding recipe DSL and providers.

================================================================================       
  Error executing action `deploy` on resource 'deploy_revision[nodejs application]'       
  ================================================================================       

  ArgumentError       
  -------------       
  Cannot find a provider for deploy_revision[nodejs application] on ubuntu version 12.04       

  Cookbook Trace:       
  ---------------       
  /tmp/kitchen/cache/cookbooks/application/libraries/default.rb:144:in `deploy_provider'       
  /tmp/kitchen/cache/cookbooks/application/libraries/default.rb:152:in `release_path'       
  /tmp/kitchen/cache/cookbooks/nodestack/recipes/application_nodejs.rb:93:in `block (3 levels) in from_file'       
  /tmp/kitchen/cache/cookbooks/application/libraries/default.rb:189:in `safe_recipe_eval'       
         /tmp/kitchen/cache/cookbooks/application/libraries/default.rb:165:in `callback'
         /tmp/kitchen/cache/cookbooks/application/providers/default.rb:193:in `run_actions_with_context'
         /tmp/kitchen/cache/cookbooks/application/providers/default.rb:172:in `block (2 levels) in run_deploy'
@marcoamorales marcoamorales changed the title [Chef 12.0] Cannot find a provider for deploy_revision[nodejs application] on ubuntu version 12.04 [Chef 12.0] Cannot find a provider for deploy_revision[application] on ubuntu version 12.04 Dec 9, 2014
@coderanger
Copy link
Member

Can you try with 12.0.1? They fixed some compat issues that might help.

@marcoamorales
Copy link
Author

Tried it with Chef 12.0.1 and I'm getting the same error.

@kiurchv
Copy link

kiurchv commented Dec 10, 2014

Same on Ubuntu 14.04:

ArgumentError
-------------
Cannot find a provider for deploy_revision[portal_api] on ubuntu version 14.04


Cookbook Trace:
---------------
/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application/libraries/default.rb:144:in `deploy_provider'

/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application/libraries/default.rb:152:in `release_path'

/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application/resources/default.rb:94:in `release_path'

/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application/libraries/default.rb:75:in `method_missing'
/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application_ruby/providers/rails.rb:77:in `block in class_from_file'
/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application/providers/default.rb:179:in `block in run_actions_with_context'
/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application/providers/default.rb:176:in `each'
/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application/providers/default.rb:176:in `run_actions_with_context'
/tmp/vagrant-chef-2/chef-solo-1/cookbooks/application/providers/default.rb:161:in `block (2 levels) in run_deploy'

@marcoamorales
Copy link
Author

I ran chef with -l debug and found these lines that might be worth sharing:

* deploy_revision[nodejs application] action deploy[2014-12-10T20:31:45+00:00] INFO: Processing deploy_revision[nodejs application] action deploy (/tmp/kitchen/cache/cookbooks/application/providers/default.rb line 123)       
       [2014-12-10T20:31:45+00:00] DEBUG: providers for generic deploy_revision resource enabled on node include: [Chef::Provider::Deploy::Revision]

[2014-12-10T20:31:45+00:00] DEBUG: providers that refused resource deploy_revision[nodejs application] were: []       
[2014-12-10T20:31:45+00:00] DEBUG: providers that support resource deploy_revision[nodejs application] include: [Chef::Provider::Deploy::Revision]       
[2014-12-10T20:31:45+00:00] DEBUG: providers that survived replacement include: [Chef::Provider::Deploy::Revision]       
       [2014-12-10T20:31:45+00:00] DEBUG: deploy_revision[nodejs application] finding current git revision

@coderanger
Copy link
Member

Now paging @danielsdeleo @sersut @lamont-granquist

From that error, it certainly sounds like it should be working.

@lamont-granquist
Copy link
Contributor

need the full stacktrace and full debug logs. from the error message it is clearly falling into the old provider platform map stuff and failing, from the debug logs it is clearly succeeding in the provider resolver so should never even get there. without a lot more context it just looks clearly insane and i don't know what to suggest.

@marcoamorales
Copy link
Author

@lamont-granquist
Copy link
Contributor

Ah yeah these lines are the issue:

https://github.com/poise/application/blob/master/libraries/default.rb#L141-L145

That should hit this API instead:

https://github.com/opscode/chef/blob/master/lib/chef/resource.rb#L682

So something like:

@deploy_resource.provider_for_action(:nothing)

Which should be backcompat with Chef-11, but might need the same arity check if you want to be backcompat with those old versions.

We probably need to extract out define_resource+friends from the Recipe DSL to get it away from method_missing and then really have a well-defined public API for building resources and providers like this.

@coderanger
Copy link
Member

@lamont-granquist Ahh got it, thanks!

@erulabs
Copy link

erulabs commented Dec 11, 2014

I can confirm this issue on Ubuntu 14.04 and CentOS 7 as well. Since there is already a stack trace for 14.04, I'll provide the CentOS 7 trace: https://gist.github.com/erulabs/70b4854f0c10f86b19f6

"Cannot find a provider for deploy_revision[STRING] on centos version 7.0.1406"

Please let me know if any additional information is required :) Thank you!

@Jimflip
Copy link

Jimflip commented Dec 30, 2014

Seeing this as well.
Is a fix likely to be forthcoming, or am i better off forking and hacking my dependency chain?

@martinb3
Copy link

martinb3 commented Jan 6, 2015

👍 wondering how to proceed. This is my last blocker on chef 12.

@Chili-Man
Copy link

I was starting to migrate to Chef 12 but then ran into this issue as well

@AndyBehr
Copy link

This is currently blocking my entire deployment. Any idea how I can fix this on my own?

@mrloop
Copy link

mrloop commented Jan 12, 2015

@andybear use fork with a fix, e.g. in your Berksfile

cookbook 'application', git: 'git@github.com:kangguru/application.git', ref: 'f7fc8797d789856a389adbe6f33647e3f5ad4ca9'

@martinb3
Copy link

@coderanger Can we help in any way, or get this commit merged in to master? kangguru@f7fc879

@coderanger
Copy link
Member

Yes, will be merging this over and doing a release before I launch in to the upgrade work.

@martinb3
Copy link

🎉 🎈 🎂 🎁

@coderanger
Copy link
Member

Got to have the one last "lol legacy" release for people that can't upgrade easily >_<

@jujugrrr
Copy link

Hi @coderanger , just noticed you changed some tests, any news on this issue? We will rollback to chef 11 otherwise :-(

@coderanger
Copy link
Member

@jujugrrr Getting regression tests in place before I merge the fix.

@coderanger
Copy link
Member

Travis tells me things are happy! https://travis-ci.org/poise/application/builds/47034505

@coderanger
Copy link
Member

Released version 4.1.6 to supermarket.

@zgchurch
Copy link

You're the best. Thanks!

@jujugrrr
Copy link

cheers!

@shaneramey
Copy link

application_python has in its metadata.rb
depends "application", "~> 3.0"

This fix wasn't applied to the 3.x cookbook, so application_python is broke on Chef 12 until 85f92b0 is applied to 3.x

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

No branches or pull requests