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

Using chef-ingredient fails with uninitialized constant Chef::Resource::ChefIngredient::DefaultHandler #140

Closed
smith opened this issue Mar 24, 2017 · 2 comments
Assignees

Comments

@smith
Copy link

smith commented Mar 24, 2017

Cookbook version

2.0.0

Chef-client version

12.12.13

Platform Details

Ubuntu 12.04 in EC2

Scenario:

Attempt to converge a recipe that uses a chef_ingredient resource

Steps to Reproduce:

A recipe like:

chef_ingredient "automate"

Expected Result:

The ingredient is installed

Actual Result:

              ================================================================================
              Recipe Compile Error in /var/chef/cache/cookbooks/chef-ingredient/resources/chef_ingredient.rb
              ================================================================================
              
              NameError
              ---------
              uninitialized constant Chef::Resource::ChefIngredient::DefaultHandler
              
              Cookbook Trace:
              ---------------
                /var/chef/cache/cookbooks/chef-ingredient/resources/chef_ingredient.rb:59:in `block in class_from_file'
                /var/chef/cache/cookbooks/chef-ingredient/resources/chef_ingredient.rb:54:in `class_from_file'
                /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb:50:in `build_from_file'
              
              Relevant File Content:
              ----------------------
              /var/chef/cache/cookbooks/chef-ingredient/resources/chef_ingredient.rb:
              
               52:  platform_family = node['platform_family']
               53:  
               54:  action_class do
               55:    include ChefIngredientCookbook::Helpers
               56:  
               57:    case platform_family
               58:    when 'debian', 'rhel', 'suse', 'windows'
               59>>     include ChefIngredient::DefaultHandler
               60:    else
               61:      # OmnitruckHandler is used for Solaris, AIX, FreeBSD, etc.
               62:      # Eventually, we would like to support all platforms with the DefaultHandler
               63:      include ChefIngredient::OmnitruckHandler
               64:    end
               65:  end
               66:  
               67:  action :install do
               68:    check_deprecated_properties
              
              Platform:
              ---------
              x86_64-linux
              
              [2017-03-24T19:37:56+00:00] ERROR: Running exception handlers
              [2017-03-24T19:37:56+00:00] ERROR: Exception handlers complete
              [2017-03-24T19:37:56+00:00] INFO: Sending resource update report (run-id: 55c3c257-f209-4498-a000-c2bf8f614fdf)
              [2017-03-24T19:37:56+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
              [2017-03-24T19:37:56+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
              [2017-03-24T19:37:56+00:00] ERROR: uninitialized constant Chef::Resource::ChefIngredient::DefaultHandler
              [2017-03-24T19:37:57+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@smith
Copy link
Author

smith commented Mar 24, 2017

Was unable to reproduce this in Test Kitchen with the versions of chef-client and Ubuntu shown in the issue.

@schisamo
Copy link
Contributor

This was fixed in #143

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

3 participants