[resolved] Test kitchen cookbook dependency error

I’m working in my local test kitchen to develop a cookbook which depends on a cookbook I’ve already written & tested locally.

I’ve run into a problem with dependencies so I’ve thrown together a couple of cookbooks, testuser & testuser2.

In testuser2 I have the following metadata.rb

depends 'testuser', '~> 0.1'

testusers metadata.rb version statement looks like this;

version ‘0.1.0’

I’ve run a berks install from the testuser cookbook but when I try to converge testuser2 I get the following error;

-----> Starting Kitchen (v1.15.0)
-----> Converging <default-centos-72>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 5.6.0...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #converge action: [Unable to satisfy constraints on package testuser, which does not exist, due to solution constraint (testuser2 = 0.1.0). Solution constraints that may result in a constraint on testuser: [(testuser2 = 0.1.0) -> (testuser ~> 0.1)]
Missing artifacts: testuser
Demand that cannot be met: (testuser2 = 0.1.0)
Unable to find a solution for demands: testuser2 (0.1.0)] on default-centos-72
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

A berks list from the testuser cookbook shows the following;

$ berks list

  • testuser (0.1.0) from source at .
  • users (4.0.3)

It’s unclear which directory you’re running the kitchen converge from by the output. What is sounds like is that testuser2 might still have the metadata name set to testuser. This might be easier to troubleshoot a bit more interactively in our Community Slack so come join us there if this is still presenting an issue.

-cheeseplus

Thanks for the reply,

I did generate both cookbooks from scratch so the metadata was not copied from one to the other. I was running the kitfchen converge from testuser2 (which has the dependency on testuser).

I have joined slack so will try and see what the folks there say and update back here.

Matt

OK so thanks to @trilltheus over at Slack the solution is as follows:

In the Berksfile of the cookbook which depends on the other cookbook, you must let Berkshelf know where to find it. I added the follownig line to the Berksfile of testuser2:

cookbook "testuser", path: "../testuser"

1 Like