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
undefined method `[]' for nil:NilClass #419
Comments
This issue seems to be caused by a breaking change in Ohai 4.0.0. See: priestjim/chef-openresty#47. They solved the problem by using the new As mentioned in the linked issue, forcing Berkshelf to use Ohai older than 4.0.0 solved the issue for me. Add the following to your Berksfile:
and then run
You may need to change the versions of other cookbooks as well, if any of them depends on Ohai |
I managed to downgrade ohai < 4.0.0 version and the nginx cookbook went fine. |
This is a transitive dep brought in by the nginx cookbook. See the following PRs for full details on why this is required: sous-chefs/nginx#419 priestjim/chef-openresty#47 Signed-off-by: Seth Chisamore <schisamo@chef.io>
This is a transitive dep brought in by the nginx cookbook. See the following PRs for full details on why this is required: sous-chefs/nginx#419 priestjim/chef-openresty#47 Signed-off-by: Seth Chisamore <schisamo@chef.io>
👍 |
This is fixed with the constrain on Ohai 3.X in #422 |
This particular issue has been pulled into the chef_nginx cookbook 2.8.0 release. The chef_nginx cookbook is a fork of this cookbook with many of the outstanding issues in the 2.7.6 release resolved. The release is backwards compatible with this cookbook outside of the name change, which obviously requires updating runlist and and metadata dependencies. I'd highly suggest giving it a try to see if this resolves you nginx cookbook woes. https://github.com/chef-cookbooks/chef_nginx |
Thanks for opening this issue. Just today we merged the changes from the chef_nginx fork of this cookbook back to master here. It’s a pretty huge change set and includes over a year of active development that resulted in several major releases. I think there’s a very high chance that this issue has been resolved with that work and at this point I’m going to close this issue out. I’d encourage you to checkout the master branch and please open this issue back up if you’re still having the problem there. Here’s the changes that were just merged in: #435 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have the following issue while trying to install wordpress cookbook which is calling the nginx one:
Recipe Compile Error in /var/chef/cache/cookbooks/wordpress/recipes/nginx.rb
NoMethodError
undefined method `[]' for nil:NilClass
Cookbook Trace:
/var/chef/cache/cookbooks/nginx/recipes/ohai_plugin.rb:27:in
from_file' /var/chef/cache/cookbooks/nginx/recipes/package.rb:21:in
from_file'/var/chef/cache/cookbooks/nginx/recipes/default.rb:22:in
from_file' /var/chef/cache/cookbooks/wordpress/recipes/nginx.rb:43:in
from_file'Relevant File Content:
/var/chef/cache/cookbooks/nginx/recipes/ohai_plugin.rb:
20: #
21:
22: ohai 'reload_nginx' do
23: plugin 'nginx'
24: action :nothing
25: end
26:
27>> template "#{node['ohai']['plugin_path']}/nginx.rb" do
28: source 'plugins/nginx.rb.erb'
29: owner 'root'
30: group node['root_group']
31: mode '0755'
32: notifies :reload, 'ohai[reload_nginx]', :immediately
33: end
34:
35: include_recipe 'ohai::default'
Chef settings on the Workstation (where the cookbook is installed):
chef-client -v
Chef: 11.16.2
knife cookbook show wordpress
wordpress 3.0.0
knife cookbook show nginx
nginx 2.7.6
knife cookbook show ohai
ohai 4.1.1
Chef settings on the client (target) server:
chef-client -v
Chef: 12.5.1
chef-client -o wordpress works fine, installs Apache and Wordpress at the end, but I want to install Nginx version.
Any clue about this error ?
Thanks.
The text was updated successfully, but these errors were encountered: