When you make a change to the version restrictions in the metadata.rb file and execute berks install in your Chef cookbook directory, you may get the error message:
Unable to satisfy constraints on package … due to solution constraint (…). Solution constraints that may result in a constraint on …: [(…)], [(…) -> (…)]
Demand that cannot be met: (…)
Artifacts for which there are conflicting dependencies: … = … -> [(…), (… ~> …)]Unable to find a solution for demands:…
- find the latest allowed versions of all referenced cookbooks,
- update the Berksfile.lock file and
- download the missing cookbooks to the cookbook cache folder at ~/.berkshelf/cookbooks
- This command executes berks install too behind the scenes.
When you add cookbooks as dependencies with the “depends” statement to the metadata.rb file of your Chef cookbook, to be able to test your cookbooks in Chef Test Kitchen, you also have to specify the location of those cookbooks in the Berksfile file.
For all the cookbooks that are available on the Chef Supermarket, one line
is sufficient to specify their location. If a cookbook is only available at GitHub, specify the location with
cookbook 'COOKBOOK_NAME', git: 'firstname.lastname@example.org:PATH_TO_COOKBOOK.git'
If the cookbook is available on the local drive of the workstation, specify the path with
cookbook 'COOKBOOK_NAME', path: '../COOKBOOK_FOLDER_NAME'
Use the above relative path if all of your cookbooks are under the same cookbooks directory.
If a reference to a Chef cookbook is missing from the Berksfile file, the following message appears when you execute berks update.
Unable to satisfy constraints on package …, which does not exist, due to solution constraint (… = …). Solution constraints that may result in a constraint on …: [(… = …) -> (… >= …)]
Missing artifacts: ...
Demand that cannot be met: (… = …)
Unable to find a solution for demands: … (…)