chef / chef/chef-cli

Improve error message when cookbook is not in policy file set

Open
#100 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Waiting on Contributor Triage: Needs Information
Dominant language
Ruby
Stars
18
Forks
23
Avg merge
5d 17h
Merged PRs (30d)
1

Description

If you add a new dep w/o running chef update you get a pretty cryptic message:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #converge action: [Expected process to exit with [0], but received '1'
---- Begin output of chef export /Users/tsmith/dev/community-cookbooks/kube/Policyfile.rb /var/folders/7q/xzcd7t315xg7n28trln90m_80000gn/T/default-debian-8-sandbox-20170905-87280-x7xt0x --force ----
STDOUT:
STDERR: Error: Invalid lockfile data
Reason: (ChefDK::DependencyConflict) Cookbook kube_test (0.0.0) has dependency constraints that cannot be met by the existing cookbook set:
Cookbook chef-apt-docker isn't included in the existing cookbook set.
---- End output of chef export /Users/tsmith/dev/community-cookbooks/kube/Policyfile.rb /var/folders/7q/xzcd7t315xg7n28trln90m_80000gn/T/default-debian-8-sandbox-20170905-87280-x7xt0x --force ----
Ran chef export /Users/tsmith/dev/community-cookbooks/kube/Policyfile.rb /var/folders/7q/xzcd7t315xg7n28trln90m_80000gn/T/default-debian-8-sandbox-20170905-87280-x7xt0x --force returned 1] on default-debian-8
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Just pointing out that this could be fixed with a simple chef update would probably help a lot of first time users.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by adding a dependency without running chef update, then start from the converge path that invokes chef export and surfaces the Invalid lockfile data output. Done means the resulting error clearly suggests running chef update for a cookbook missing from the policy file set.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.