# \[resolved\] Test kitchen cookbook dependency error

**URL:** <https://discourse.chef.io/t/resolved-test-kitchen-cookbook-dependency-error/10686>\
**Category:** Chef Infra (archive)\
**Created:** [March 31, 2017, 3:06pm UTC](https://discourse.chef.io/t/resolved-test-kitchen-cookbook-dependency-error/10686 "2017-03-31T15:06:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aarrgghh765](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@aarrgghh765](https://discourse.chef.io/u/aarrgghh765)\
**Post date:** [March 31, 2017, 3:06pm UTC](https://discourse.chef.io/t/resolved-test-kitchen-cookbook-dependency-error/10686/1 "2017-03-31T15:06:07Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![cheeseplus](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cheeseplus/32/960_2.png) [@cheeseplus](https://discourse.chef.io/u/cheeseplus)\
**Post date:** [April 3, 2017, 1:13pm UTC](https://discourse.chef.io/t/resolved-test-kitchen-cookbook-dependency-error/10686/2 "2017-04-03T13:13:21Z")

</div>

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](http://community-slack.chef.io/) so come join us there if this is still presenting an issue.

-cheeseplus

---

<div class="post-metadata">

**Author:** ![aarrgghh765](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@aarrgghh765](https://discourse.chef.io/u/aarrgghh765)\
**Post date:** [April 4, 2017, 1:33pm UTC](https://discourse.chef.io/t/resolved-test-kitchen-cookbook-dependency-error/10686/3 "2017-04-04T13:33:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aarrgghh765](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@aarrgghh765](https://discourse.chef.io/u/aarrgghh765)\
**Post date:** [April 4, 2017, 2:05pm UTC](https://discourse.chef.io/t/resolved-test-kitchen-cookbook-dependency-error/10686/4 "2017-04-04T14:05:19Z")

</div>

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"`
