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

12.4.0.rc.0 LWRP Regression #3463

Closed
cwebberOps opened this issue Jun 2, 2015 · 5 comments
Closed

12.4.0.rc.0 LWRP Regression #3463

cwebberOps opened this issue Jun 2, 2015 · 5 comments

Comments

@cwebberOps
Copy link
Contributor

So... I haven't been able to track down exactly what is broken, but the LWRP used by the chef_handler cookbook broke between 12.3.0 and 12.4.0.rc.0. I have created a way to reproduce the bug: https://github.com/cwebberOps/issue_repro. kitchen converge current will install 12.3.0 and works fine. kitchen converge rc will install 12.4.0.rc.0 and blows up. You will need the kitchen-appbundle-updater gem to run the test.

The error I see is:

         * chef_handler[BuildCookbook::HipChatHandler] action enable/tmp/kitchen/cache/cookbooks/chef_handler/providers/default.rb:71: warning: toplevel constant ChefHandler referenced by Chef::Resource::ChefHandler


           ================================================================================
           Error executing action `enable` on resource 'chef_handler[BuildCookbook::HipChatHandler]'
           ================================================================================

           NoMethodError
       -------------
           undefined method `new' for ChefHandler:Module

           Cookbook Trace:
           ---------------

           /tmp/kitchen/cache/cookbooks/issue_repro/recipes/default.rb:29:in `from_file'

           Resource Declaration:
       ---------------------
           suppressed sensitive resource output

           Compiled Resource:
           ------------------
       suppressed sensitive resource output


         ================================================================================
         Recipe Compile Error in /tmp/kitchen/cache/cookbooks/issue_repro/recipes/default.rb
         ================================================================================

         NoMethodError
         -------------
         chef_handler[BuildCookbook::HipChatHandler] (issue_repro::default line 23) had an error: NoMethodError: undefined method `new' for ChefHandler:Module

         Cookbook Trace:
         ---------------
           /tmp/kitchen/cache/cookbooks/chef_handler/providers/default.rb:71:in `load_current_resource'
           /tmp/kitchen/cache/cookbooks/issue_repro/recipes/default.rb:29:in `from_file'

         Relevant File Content:
         ----------------------
         /tmp/kitchen/cache/cookbooks/chef_handler/providers/default.rb:

          64:      converge_by("disable #{new_resource} as a #{type} handler") do
          65:        unregister_handler(type, new_resource.class_name)
          66:      end
          67:    end
          68:  end
          69:
          70:  def load_current_resource
          71>>   @current_resource = Chef::Resource::ChefHandler.new(new_resource.name)
          72:    @current_resource.class_name(new_resource.class_name)
          73:    @current_resource.source(new_resource.source)
          74:    @current_resource
          75:  end
          76:
          77:  private
          78:
          79:  def collect_args(resource_args = [])
          80:    if resource_args.is_a? Array


         Running handlers:
       [2015-06-02T03:35:44+00:00] ERROR: Running exception handlers
         Running handlers complete
       [2015-06-02T03:35:44+00:00] ERROR: Exception handlers complete

       Chef Client failed. 5 resources updated in 39.431304765 seconds
       [2015-06-02T03:35:44+00:00] ERROR: chef_handler[BuildCookbook::HipChatHandler] (issue_repro::default line 23) had an error: NoMethodError: undefined method `new' for ChefHandler:Module
       [2015-06-02T03:35:44+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

This has basically taken out all of my pipelines in Delivery because it is how I was loading the handler.

/cc @chef/client-maintainers

@cwebberOps
Copy link
Contributor Author

If I had to guess... #3269 is what is at the heart of this.

@jkeiser
Copy link
Contributor

jkeiser commented Jun 2, 2015

I'd guess it has something to do with that too. However, this is interesting:

undefined methodnew' for ChefHandler:Module`

I'm super confused about this one--how is there a module named ChefHandler?

@cwebberOps
Copy link
Contributor Author

@jkeiser so the cookbook that is broken is: https://github.com/opscode-cookbooks/chef_handler

My guess is that there is something to do with the LWRP nature of resource.

@jkeiser
Copy link
Contributor

jkeiser commented Jun 2, 2015

@cwebberOps @lamont-granquist and I got together and I've got a fix whipped up (in testing now). Thanks!

@jkeiser
Copy link
Contributor

jkeiser commented Jun 3, 2015

This should be fixed. Can you give it a try on master and let us know?

@chef chef locked and limited conversation to collaborators Nov 16, 2017
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

3 participants