chef / chef/chef-cli

Handle cookbook_version being Nil

Open
#55 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Triage: Needs Information Type: Bug
Dominant language
Ruby
Stars
18
Forks
23
Avg merge
5d 17h
Merged PRs (30d)
1

Description

Version:

All versions of Chef CLI

Environment:

Tested in Docker

Scenario:

Run chef install (which resolves to chef-cli install) on a policyfile that has a cookbook dependency with missing information

Steps to Reproduce:

I can reproduce this each time on my repo though I do not know which of my cookbooks/dependencies are causing it

Expected Result:

Policyfile.lock should be generated

Actual Result:

Caching Cookbooks...
Error: Failed to generate Policyfile.lock
Reason: (NoMethodError) undefined method `metadata' for nil:NilClass

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

Start by reproducing the failure with chef install on a Policyfile containing a cookbook dependency with missing information, then trace the dependency-resolution path that raises undefined method metadata for nil:NilClass. Identify which cookbook or dependency produces the nil cookbook_version; done means the lockfile is generated or the failure reports the missing information clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.