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

Failure to update a specific Policy's cookbook when cookbooks cache is outdated #210

Open
Annih opened this issue Jun 19, 2022 · 0 comments
Labels
Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.

Comments

@Annih
Copy link
Contributor

Annih commented Jun 19, 2022

Version:

2.0.10

Environment:

  • ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]
  • rbenv 1.2.0-14-gc6cc0a1

Scenario:

Update a specific cookbook from a policy, without updating its deps, when the cookbooks cache is outdated.

Steps to Reproduce:

  1. Setup a Policyfile with at least one not-up-to-date cookbook
  2. Install the policy - chef-cli install
  3. Clear your cookbooks cache - rm -rf ~/.chef-workstation/cache/cookbooks/
  4. Update the outdated cookbook using the --exclude_deps option -- chef-cli update Policyfile.rb --exclude-deps <the_cookbook>

I personally reproduce it easily with yum-epel 4.0, here are:

Expected Result:

✅Exit code 0
✅No error message
✅Cookbook updated in the Policyfile.lock.json

Actual Result:

❎Exit code 1
❎Error message is printed:

Lockfile written to Policyfile.lock.json
Error: Failed to generate Policyfile.lock
Reason: (ChefCLI::CachedCookbookNotFound) Cookbook yum-epel' not found at expected cache location yum-epel-4.0.0-supermarket.chef.io' (full path: `/.chef-workstation/cache/cookbooks/yum-epel-4.0.0-supermarket.chef.io')

✅Fun thing Policyfile.lock.json has been written before the error and the cookbook is properly updated

@Annih Annih added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Jun 19, 2022
@sanjain-progress sanjain-progress added Triage: Confirmed Indicates and issue has been confirmed as described. and removed Status: Untriaged An issue that has yet to be triaged. labels Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

2 participants