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

show and edit commands fail with "undefined method 'version' for nil:NilClass" #42

Open
jlfranklin opened this issue Oct 5, 2019 · 0 comments

Comments

@jlfranklin
Copy link

Create worked fine, but then I couldn't show or edit the data bags.

$ knife -v
Chef: 12.14.60

Sanitized output follows:

$ knife solo --local-mode data bag edit my_project database -c ./solo.rb -VV
INFO: Using configuration from /path/to/project/solo.rb
INFO: Started chef-zero at chefzero://localhost:8889 with repository at /path/to/project
  One version per cookbook

/var/lib/gems/2.3.0/gems/knife-solo_data_bag-2.1.0/lib/chef/knife/solo_data_bag_edit.rb:32:in `run': undefined method `version' for nil:NilClass (NoMethodError)
	from /usr/lib/ruby/vendor_ruby/chef/knife.rb:430:in `block in run_with_pretty_exceptions'
	from /usr/lib/ruby/vendor_ruby/chef/local_mode.rb:44:in `with_server_connectivity'
	from /usr/lib/ruby/vendor_ruby/chef/knife.rb:429:in `run_with_pretty_exceptions'
	from /usr/lib/ruby/vendor_ruby/chef/knife.rb:219:in `run'
	from /usr/lib/ruby/vendor_ruby/chef/application/knife.rb:156:in `run'
	from /usr/bin/knife:25:in `<main>'

The solo.rb file sets some paths to be project-relative:

root = File.absolute_path(File.dirname(__FILE__))

file_cache_path '/var/chef/cache'
cookbook_path root + '/cookbooks'
environment_path root + '/environments'
data_bag_path root + '/data_bags'

This is using chef installed from the Debian stretch repos.

Commenting out the check in the solo_data_bag_edit.rb or solo_data_bag_show.rb "fixes" it.

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

1 participant