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

undefined method `delete' for nil:NilClass #34

Closed
svallory opened this issue Jan 24, 2016 · 3 comments
Closed

undefined method `delete' for nil:NilClass #34

svallory opened this issue Jan 24, 2016 · 3 comments
Milestone

Comments

@svallory
Copy link

I'm getting this error when running the default recipe:

ERROR: vault_config[/home/vault/.vault.json] (hashicorp-vault::default line 11) had an error: NoMethodError: undefined method `delete' for nil:NilClass

My wrapper notebook

include_recipe 'wrap-consul::default'

node.default['vault']['config']['backend_type'] = 'consul'
include_recipe 'hashicorp-vault::default'

I'm using version 1.4

Here is the stack trace:

Generated at 2016-01-24 12:23:25 +0000
NoMethodError: vault_config[/home/vault/.vault.json] (hashicorp-vault::default line 11) had an error: NoMethodError: undefined method `delete' for nil:NilClass
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/data_bag_item.rb:129:in `from_hash'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/data_bag_item.rb:160:in `load'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-vault-2.6.1/lib/chef-vault/item.rb:318:in `data_bag_item_type'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-vault-2.6.1/lib/chef-vault/item.rb:296:in `vault?'
/tmp/vagrant-chef/bff31c3b408ec7b44050af611ad8ca88/cookbooks/chef-vault/libraries/helpers.rb:36:in `chef_vault_item'
/tmp/vagrant-chef/bff31c3b408ec7b44050af611ad8ca88/cookbooks/hashicorp-vault/libraries/vault_config.rb:76:in `block (2 levels) in <class:VaultConfig>'
/tmp/vagrant-chef/bff31c3b408ec7b44050af611ad8ca88/cookbooks/poise/files/halite_gem/poise/helpers/subcontext_block.rb:54:in `instance_eval'
/tmp/vagrant-chef/bff31c3b408ec7b44050af611ad8ca88/cookbooks/poise/files/halite_gem/poise/helpers/subcontext_block.rb:54:in `subcontext_block'
/tmp/vagrant-chef/bff31c3b408ec7b44050af611ad8ca88/cookbooks/poise/files/halite_gem/poise/helpers/notifying_block.rb:67:in `notifying_block'
/tmp/vagrant-chef/bff31c3b408ec7b44050af611ad8ca88/cookbooks/hashicorp-vault/libraries/vault_config.rb:66:in `block in <class:VaultConfig>'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider.rb:144:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource.rb:596:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:74:in `run_action'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `each'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:105:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:647:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:642:in `catch'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:642:in `converge'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:681:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:271:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:261:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:215:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:203:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/solo.rb:286:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/solo.rb:275:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/solo.rb:275:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/solo.rb:253:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:58:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:54:in `load'
/usr/bin/chef-solo:54:in `<main>'
@sh9189
Copy link
Contributor

sh9189 commented Feb 17, 2016

The default recipe needs a tls key and cert as a chef-vault item. This is supplied using a data bag item as seen here for test kitchen.
Alternatively you can also disable tls by setting the following attribute
default['vault']['config']['tls_disable'] = 'true'

@johnbellone johnbellone added this to the 2.0 milestone Mar 2, 2016
@johnbellone
Copy link
Contributor

This has been updated in latest master branch set of commits and will be released as 2.0.

@lock
Copy link

lock bot commented May 19, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 19, 2019
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