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

Recipe Compile Error with ohai 4.0.0 #22

Closed
mawatech opened this issue May 19, 2016 · 11 comments
Closed

Recipe Compile Error with ohai 4.0.0 #22

mawatech opened this issue May 19, 2016 · 11 comments

Comments

@mawatech
Copy link

See also the Changelog for version 4.0.0 https://supermarket.chef.io/cookbooks/ohai#changelog

Recipe: open-xchange-singlenode::dovecot
* chef_gem[mail] action install
- install version 2.6.4 of package mail

     ================================================================================
     Recipe Compile Error in /tmp/kitchen/cookbooks/qa-singlenode/recipes/default.rb
     ================================================================================

     NoMethodError
     -------------
     undefined method `[]' for nil:NilClass

     Cookbook Trace:
     ---------------
       /tmp/kitchen/cookbooks/dovecot/recipes/ohai_plugin.rb:33:in `from_file'
       /tmp/kitchen/cookbooks/dovecot/recipes/default.rb:22:in `from_file'
       /tmp/kitchen/cookbooks/open-xchange-singlenode/recipes/dovecot.rb:35:in `from_file'
       /tmp/kitchen/cookbooks/open-xchange-singlenode/recipes/mailstore.rb:9:in `from_file'
       /tmp/kitchen/cookbooks/qa-singlenode/recipes/default.rb:116:in `from_file'

     Relevant File Content:
     ----------------------
     /tmp/kitchen/cookbooks/dovecot/recipes/ohai_plugin.rb:

      26:  source_dir = ohai7? ? 'ohai7_plugins' : 'ohai_plugins'
      27:  
      28:  ohai 'reload_dovecot' do
      29:    plugin 'dovecot'
      30:    action :nothing
      31:  end
      32:  
      33>> template "#{node['ohai']['plugin_path']}/dovecot.rb" do
      34:    source "#{source_dir}/dovecot.rb.erb"
      35:    owner 'root'
      36:    group 'root'
      37:    mode '0755'
      38:    variables(
      39:      enable_build_options: node['dovecot']['ohai_plugin']['build-options']
      40:    )
      41:    notifies :reload, 'ohai[reload_dovecot]', :immediately
      42:  end

     Platform:
     ---------
     x86_64-linux


     Running handlers:
   [2016-05-19T06:53:55+00:00] ERROR: Running exception handlers
     Running handlers complete
@zuazo zuazo added the bug label May 19, 2016
@zuazo
Copy link
Owner

zuazo commented May 19, 2016

Thank you for reporting the issue, @mawatech.

Until the fix is ready, you will need to set ohai cookbook version to 3 using your wrapper cookbook:

# metadata.rb
depends 'ohai', '~> 3.0'

@mawatech
Copy link
Author

Thx for your reply, i already did this and i can confirm that this "workaround" works :-)

@ericgoedtel
Copy link

I actually had to set this in the Berksfile and not the metadata.rb file. Is that expected?

@zuazo
Copy link
Owner

zuazo commented May 24, 2016

You can use the Berksfile if you prefer. Depending on how you are using Chef. But in the metadata it should also work.

@zuazo zuazo closed this as completed in f5ccd82 Jul 27, 2016
@zuazo
Copy link
Owner

zuazo commented Jul 27, 2016

We have udpated the code to work with ohai cookbook version 4 in #23 and fixed this in f5ccd82.

@zuazo
Copy link
Owner

zuazo commented Jul 28, 2016

I have released version 2.5.0 with the fix, but using ohai cookbook version 3.

The update to version 4 will be released in version 3.0.0 because it breaks Chef 11 compatibility.

@lamont-granquist
Copy link

@zuazo this version 2.5.0 of this cookbook will not depsolve with e.g. the chef_nginx cookbook which pins ohai to ~> 4.0, needs a 3.0 release that drops 11.x support

@zuazo
Copy link
Owner

zuazo commented Oct 8, 2016

OK, thanks @lamont-granquist. I'm going to try to make a release tomorrow.

@lamont-granquist
Copy link

my home mailserver thanks you =)

@zuazo
Copy link
Owner

zuazo commented Oct 9, 2016

Your are welcome ;-)

Ohai cookbook 4 support released in 3.0.0.

@lamont-granquist
Copy link

👍

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

4 participants