chef / chef/chef-cli

Parallel policy dependencies fail with frozen cookbook error

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

Nobody has claimed this yet.

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

Description

Description

When creating (at least) two policy files that include a common policy file, the push to the chef server fails with:

Uploading policy policy1-v1-2019-03-18-controller (1b1bb7c956) to policy group policy-group-a
Error: Failed to upload policy to policy group policy-group-a
Reason: (Chef::Exceptions::CookbookFrozen) Version 1.0.1 of cookbook mycookbook is frozen. Use --force to override.

ChefDK Version

ChefDK: 3.8.14-1

Platform Version

OS: Ubuntu 18.04

Replication Case

Create base policy, i.e: Policyfile.rb:

  name 'policy-v1'
  default_source :chef_server, '${local.chef-server}'
  run_list 'cookbook::default'
  cookbook 'cookbook', '> 0.0.0'

Create second and third policies, i.e:

Policyfile_policy1:

  name 'policy1-v1'
  default_source :chef_server, '${local.chef-server}'
  include_policy "policy-v1", policy_group: "policy-group", server: "${local.chef-server}"
  run_list 'cookbook::recipe1'

Policyfile_policy2.rb

  name 'policy2-v1'
  default_source :chef_server, '${local.chef-server}'
  include_policy "policy-v1", policy_group: "policy-group", server: "${local.chef-server}"
  run_list 'cookbook::recipe2'

Then install and push each one, the last one should fail:

$ chef install Policyfile.rb && chef push policy-group Policyfile.rb
$ chef install Policyfile_policy1.rb && chef push policy-group-1 Policyfile_policy1.rb
$ chef install Policyfile_policy2.rb && chef push policy-group-2 Policyfile_policy2.rb

Notes

I am not sure this is a bug with chefdk or with chef-server, starting here in hope to get in the right direction.

NOTE: CHEFDK BUGS ONLY

This issue tracker is for the code contained within this repo -- chefdk.

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 using Policyfile.rb, Policyfile_policy1.rb, and Policyfile_policy2.rb, then run the three chef install and push commands against the stated policy groups. Trace whether the failure is in the chef CLI or Chef Server, and consider the issue resolved when the parallel policy pushes complete without the frozen cookbook error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.