Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Fails if Policyfile.lock.json is missing #5

Open
RyanFrantz opened this issue Sep 21, 2017 · 1 comment
Open

Fails if Policyfile.lock.json is missing #5

RyanFrantz opened this issue Sep 21, 2017 · 1 comment
Labels

Comments

@RyanFrantz
Copy link
Contributor

RyanFrantz commented Sep 21, 2017

If the current repo does not have a Policyfile.lock.json file, chef exec umami will fail with the following message:

mcleod8@ip-1-70-103-68:~/chef-cookbooks/orion$ chef exec umami
/home/rmcleod8/.chefdk/gem/ruby/2.3.0/gems/chef-umami-0.0.2/lib/chef-umami/runner.rb:52:in `validate_lock_file!': Unable to locate 'Policyfile.lock.json' You may need to run `chef install` to generate it. (Umami::InvalidPolicyfileLockFilename)
           from /home/rmcleod8/.chefdk/gem/ruby/2.3.0/gems/chef-umami-0.0.2/lib/chef-umami/runner.rb:73:in `run'
           from /home/rmcleod8/.chefdk/gem/ruby/2.3.0/gems/chef-umami-0.0.2/bin/umami:7:in `<top (required)>'
           from /home/rmcleod8/.chefdk/gem/ruby/2.3.0/bin/umami:22:in `load'
           from /home/rmcleod8/.chefdk/gem/ruby/2.3.0/bin/umami:22:in `<main>'
@RyanFrantz RyanFrantz added the bug label Sep 21, 2017
@RyanFrantz
Copy link
Contributor Author

There is a similar issue if the lock file hasn't been updated (i.e. metadata.rb has been bumped and chef update has not been run):

[rfrantz1@dev ~/git/virgo] (master) $ chef exec umami

Exporting the policy, related cookbooks, and a valid client configuration...
Generating a new Policyfile from 'Policyfile.rb'...
Installing cookbooks from lock
Installing virgo     1.10.0
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.4.3/lib/chef-dk/policyfile_services/install.rb:119:in `rescue in install_from_lock': Failed to install cookbooks from lockfile (ChefDK::PolicyfileInstallError)
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.4.3/lib/chef-dk/policyfile_services/install.rb:115:in `install_from_lock'
	from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.4.3/lib/chef-dk/policyfile_services/install.rb:60:in `run'
	from /home/rfrantz1/.chefdk/gem/ruby/2.3.0/gems/chef-umami-0.0.4/lib/chef-umami/policyfile/exporter.rb:59:in `install_policy'
	from /home/rfrantz1/.chefdk/gem/ruby/2.3.0/gems/chef-umami-0.0.4/lib/chef-umami/policyfile/exporter.rb:85:in `export'
	from /home/rfrantz1/.chefdk/gem/ruby/2.3.0/gems/chef-umami-0.0.4/lib/chef-umami/runner.rb:75:in `run'
	from /home/rfrantz1/.chefdk/gem/ruby/2.3.0/gems/chef-umami-0.0.4/bin/umami:7:in `<top (required)>'
	from /home/rfrantz1/.chefdk/gem/ruby/2.3.0/bin/umami:22:in `load'
	from /home/rfrantz1/.chefdk/gem/ruby/2.3.0/bin/umami:22:in `<main>'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant