# Question regarding berks install

**URL:** <https://discourse.chef.io/t/question-regarding-berks-install/6416>\
**Category:** Chef Infra (archive)\
**Created:** [March 17, 2015, 5:29pm UTC](https://discourse.chef.io/t/question-regarding-berks-install/6416 "2015-03-17T17:29:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_F](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@Chris\_F](https://discourse.chef.io/u/Chris_F)\
**Post date:** [March 17, 2015, 5:29pm UTC](https://discourse.chef.io/t/question-regarding-berks-install/6416/1 "2015-03-17T17:29:22Z")

</div>

I have an environment cookbook, whose metadata.rb file looks like this

name ‘my\_env\_cookbook\_dev’  
(snip)  
version ‘0.1.0’

depends ‘common’, ‘= 1.2.0’

I have a Berksfile that looks like this

source “[https://supermarket.chef.io](https://supermarket.chef.io)”

metadata

# Community cookbooks

cookbook 'chef-client’  
cookbook 'powershell’  
cookbook ‘push-jobs’

# Internal cookbooks

cookbook ‘common’, git: ‘git@git-repo.domain.com:mycookbooks/common.git’

The metadata.rb file for the common cookbook in the git repo looks like

name ‘common’  
(snip)  
version ‘1.2.0’

When I do a berks install, I get

berks install  
Resolving cookbook dependencies…  
Fetching ‘arqiva\_rni\_env\_dev’ from source at .  
Fetching cookbook index from [https://supermarket.chef.io](https://supermarket.chef.io)…  
Unable to satisfy constraints on package common due to solution constraint (my\_env\_cookbook\_dev = 0.1.0). Solution constraints that may result in a constraint on common: [(my\_env\_cookbook\_dev = 0.1.0) -\> (common = 1.2.0)], [(common = 1.0.0)]  
Demand that cannot be met: (my\_env\_cookbook\_dev = 0.1.0)  
Artifacts for which there are conflicting dependencies: common = 1.0.0 -\> []Unable to find a solution for demands: my\_env\_cookbook\_dev (0.1.0), build-essential (2.1.3), chef-client (4.2.4), chef\_handler (1.1.6), common (1.0.0), cron (1.6.1), logrotate (1.9.0), ms\_dotnet2 (1.0.0), ms\_dotnet4 (1.0.2), ms\_dotnet45 (2.0.0), powershell (3.0.7), push-jobs (2.2.0), runit (1.5.18), windows (1.36.6), yum (3.5.3), yum-epel (0.6.0)

Where is the common v1.0.0 coming from?

Chris

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [March 18, 2015, 3:59pm UTC](https://discourse.chef.io/t/question-regarding-berks-install/6416/2 "2015-03-18T15:59:35Z")

</div>

Are any of these cookbooks locked in an existing lockfile?

--  
Daniel DeLeo

On Tuesday, March 17, 2015 at 10:29 AM, Fouts, Chris wrote:

> I have an environment cookbook, whose metadata.rb file looks like this
> 
> name ‘my\_env\_cookbook\_dev'  
> (snip)  
> version '0.1.0'
> 
> depends 'common', '= 1.2.0'
> 
> I have a Berksfile that looks like this
> 
> source "[https://supermarket.chef.io](https://supermarket.chef.io)"
> 
> metadata
> 
> # Community cookbooks
> 
> cookbook 'chef-client'  
> cookbook 'powershell'  
> cookbook 'push-jobs'
> 
> # Internal cookbooks
> 
> cookbook 'common', git: 'git@git-repo.domain.com ([mailto:git@git-repo.domain.com](mailto:git@git-repo.domain.com)):mycookbooks/common.git'
> 
> The metadata.rb file for the common cookbook in the git repo looks like
> 
> name ‘common’  
> (snip)  
> version '1.2.0'
> 
> When I do a berks install, I get
> 
> berks install  
> Resolving cookbook dependencies...  
> Fetching 'arqiva\_rni\_env\_dev' from source at .  
> Fetching cookbook index from [https://supermarket.chef.io](https://supermarket.chef.io)...  
> Unable to satisfy constraints on package common due to solution constraint (my\_env\_cookbook\_dev = 0.1.0). Solution constraints that may result in a constraint on common: [(my\_env\_cookbook\_dev = 0.1.0) -\> (common = 1.2.0)], [(common = 1.0.0)]  
> Demand that cannot be met: (my\_env\_cookbook\_dev = 0.1.0)  
> Artifacts for which there are conflicting dependencies: common = 1.0.0 -\> Unable to find a solution for demands: my\_env\_cookbook\_dev (0.1.0), build-essential (2.1.3), chef-client (4.2.4), chef\_handler (1.1.6), common (1.0.0), cron (1.6.1), logrotate (1.9.0), ms\_dotnet2 (1.0.0), ms\_dotnet4 (1.0.2), ms\_dotnet45 (2.0.0), powershell (3.0.7), push-jobs (2.2.0), runit (1.5.18), windows (1.36.6), yum (3.5.3), yum-epel (0.6.0)
> 
> Where is the common v1.0.0 coming from?
> 
> Chris

---

<div class="post-metadata">

**Author:** ![Chris\_F](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@Chris\_F](https://discourse.chef.io/u/Chris_F)\
**Post date:** [March 18, 2015, 4:06pm UTC](https://discourse.chef.io/t/question-regarding-berks-install/6416/3 "2015-03-18T16:06:59Z")

</div>

Thanks.

I fixed my problem by deleting my ~/.berkshelf directory and starting over. How could I have fixed this without deleting ~/.berkshelf?

Chris

-----Original Message-----  
From: Daniel DeLeo [[mailto:ddeleo@kallistec.com](mailto:ddeleo@kallistec.com)] On Behalf Of Daniel DeLeo  
Sent: Wednesday, March 18, 2015 12:00 PM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: Question regarding berks install

Are any of these cookbooks locked in an existing lockfile?

--  
Daniel DeLeo

On Tuesday, March 17, 2015 at 10:29 AM, Fouts, Chris wrote:

> I have an environment cookbook, whose metadata.rb file looks like this
> 
> name ‘my\_env\_cookbook\_dev'  
> (snip)  
> version '0.1.0'
> 
> depends 'common', '= 1.2.0'
> 
> I have a Berksfile that looks like this
> 
> source "[https://supermarket.chef.io](https://supermarket.chef.io)"
> 
> metadata
> 
> # Community cookbooks
> 
> cookbook 'chef-client'  
> cookbook 'powershell'  
> cookbook 'push-jobs'
> 
> # Internal cookbooks
> 
> cookbook 'common', git: 'git@git-repo.domain.com ([mailto:git@git-repo.domain.com](mailto:git@git-repo.domain.com)):mycookbooks/common.git'
> 
> The metadata.rb file for the common cookbook in the git repo looks  
> like
> 
> name ‘common’  
> (snip)  
> version '1.2.0'
> 
> When I do a berks install, I get
> 
> berks install  
> Resolving cookbook dependencies...  
> Fetching 'arqiva\_rni\_env\_dev' from source at .  
> Fetching cookbook index from [https://supermarket.chef.io](https://supermarket.chef.io)...  
> Unable to satisfy constraints on package common due to solution  
> constraint (my\_env\_cookbook\_dev = 0.1.0). Solution constraints that  
> may result in a constraint on common: [(my\_env\_cookbook\_dev = 0.1.0)  
> -\> (common = 1.2.0)], [(common = 1.0.0)] Demand that cannot be met:  
> (my\_env\_cookbook\_dev = 0.1.0) Artifacts for which there are  
> conflicting dependencies: common = 1.0.0 -\> Unable to find a  
> solution for demands: my\_env\_cookbook\_dev (0.1.0), build-essential  
> (2.1.3), chef-client (4.2.4), chef\_handler (1.1.6), common (1.0.0),  
> cron (1.6.1), logrotate (1.9.0), ms\_dotnet2 (1.0.0), ms\_dotnet4  
> (1.0.2), ms\_dotnet45 (2.0.0), powershell (3.0.7), push-jobs (2.2.0),  
> runit (1.5.18), windows (1.36.6), yum (3.5.3), yum-epel (0.6.0)
> 
> Where is the common v1.0.0 coming from?
> 
> Chris

---

<div class="post-metadata">

**Author:** ![Cliff\_Pracht](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@Cliff\_Pracht](https://discourse.chef.io/u/Cliff_Pracht)\
**Post date:** [March 18, 2015, 4:18pm UTC](https://discourse.chef.io/t/question-regarding-berks-install/6416/4 "2015-03-18T16:18:09Z")

</div>

Hi Chris,

See explanation from Seth. Ran into the same issue. We ended up changing out BERKSHELF\_PATH on Jenkins and working on a PR.

> <https://github.com/berkshelf/berkshelf/issues/1361>
>
> As I understand it, \`berks\` will keep cookbook versions in local cache of all co…okbooks that were previously used.    
> 
> Now in the case where we want decommission a cookbook or version of cookbook (in Supermarket), we would like for \`berks install\` to fail (Eg not use local cache). 
> 
> How does \`berks install\` handle this situation?  
> 
> I suppose we could do a \`rm -rf\` to cache folder, but that seems not very elegant and could be problematic especially if there are multiple jobs of berks install running on same system (we are planning to run on Jenkins)..
> 
> A flag within berks to ignore local cache would be ideal (like \`gem install\` has an option -r, -​-remote - Restrict operations to the REMOTE domain) http://guides.rubygems.org/command-reference/#gem-install
> 
> Cliff

If you are using supermarket, you also have to be aware that lock can come from that as well from one of it’s dependancies and chef ignore does not ignore it.

> <https://github.com/chef/chef/issues/2994>
>
> This seems to be a change from 11.X. Reported by @mcalb. To reproduce \[see comm…ent below, original comment deleted by @pburkholder since it was pretty unhelpful\]

Cliff

On 3/18/15, 12:06 PM, "Fouts, Chris" [Chris.Fouts@Sensus.com](mailto:Chris.Fouts@Sensus.com) wrote:

> Thanks.
> 
> I fixed my problem by deleting my ~/.berkshelf directory and starting over. How could I have fixed this without deleting ~/.berkshelf?
> 
> Chris
> 
> -----Original Message-----  
> From: Daniel DeLeo [[mailto:ddeleo@kallistec.com](mailto:ddeleo@kallistec.com)] On Behalf Of Daniel DeLeo  
> Sent: Wednesday, March 18, 2015 12:00 PM  
> To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Re: Question regarding berks install
> 
> Are any of these cookbooks locked in an existing lockfile?
> 
> --  
> Daniel DeLeo
> 
> On Tuesday, March 17, 2015 at 10:29 AM, Fouts, Chris wrote:
> 
> > I have an environment cookbook, whose metadata.rb file looks like this
> > 
> > name ‘my\_env\_cookbook\_dev'  
> > (snip)  
> > version '0.1.0'
> > 
> > depends 'common', '= 1.2.0'
> > 
> > I have a Berksfile that looks like this
> > 
> > source "[https://supermarket.chef.io](https://supermarket.chef.io)"
> > 
> > metadata
> > 
> > # Community cookbooks
> > 
> > cookbook 'chef-client'  
> > cookbook 'powershell'  
> > cookbook 'push-jobs'
> > 
> > # Internal cookbooks
> > 
> > cookbook 'common', git: 'git@git-repo.domain.com ([mailto:git@git-repo.domain.com](mailto:git@git-repo.domain.com)):mycookbooks/common.git'
> > 
> > The metadata.rb file for the common cookbook in the git repo looks  
> > like
> > 
> > name ‘common’  
> > (snip)  
> > version '1.2.0'
> > 
> > When I do a berks install, I get
> > 
> > berks install  
> > Resolving cookbook dependencies...  
> > Fetching 'arqiva\_rni\_env\_dev' from source at .  
> > Fetching cookbook index from [https://supermarket.chef.io](https://supermarket.chef.io)...  
> > Unable to satisfy constraints on package common due to solution  
> > constraint (my\_env\_cookbook\_dev = 0.1.0). Solution constraints that  
> > may result in a constraint on common: [(my\_env\_cookbook\_dev = 0.1.0)  
> > -\> (common = 1.2.0)], [(common = 1.0.0)] Demand that cannot be met:  
> > (my\_env\_cookbook\_dev = 0.1.0) Artifacts for which there are  
> > conflicting dependencies: common = 1.0.0 -\> Unable to find a  
> > solution for demands: my\_env\_cookbook\_dev (0.1.0), build-essential  
> > (2.1.3), chef-client (4.2.4), chef\_handler (1.1.6), common (1.0.0),  
> > cron (1.6.1), logrotate (1.9.0), ms\_dotnet2 (1.0.0), ms\_dotnet4  
> > (1.0.2), ms\_dotnet45 (2.0.0), powershell (3.0.7), push-jobs (2.2.0),  
> > runit (1.5.18), windows (1.36.6), yum (3.5.3), yum-epel (0.6.0)
> > 
> > Where is the common v1.0.0 coming from?
> > 
> > Chris

---

<div class="post-metadata">

**Author:** ![Chris\_F](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@Chris\_F](https://discourse.chef.io/u/Chris_F)\
**Post date:** [March 18, 2015, 6:07pm UTC](https://discourse.chef.io/t/question-regarding-berks-install/6416/5 "2015-03-18T18:07:37Z")

</div>

Thanks you!

Chris

-----Original Message-----  
From: Cliff Pracht [[mailto:cpracht@ebsco.com](mailto:cpracht@ebsco.com)]  
Sent: Wednesday, March 18, 2015 12:18 PM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: RE: Re: Question regarding berks install

Hi Chris,

See explanation from Seth. Ran into the same issue. We ended up changing out BERKSHELF\_PATH on Jenkins and working on a PR.

> <https://github.com/berkshelf/berkshelf/issues/1361>
>
> As I understand it, \`berks\` will keep cookbook versions in local cache of all co…okbooks that were previously used.    
> 
> Now in the case where we want decommission a cookbook or version of cookbook (in Supermarket), we would like for \`berks install\` to fail (Eg not use local cache). 
> 
> How does \`berks install\` handle this situation?  
> 
> I suppose we could do a \`rm -rf\` to cache folder, but that seems not very elegant and could be problematic especially if there are multiple jobs of berks install running on same system (we are planning to run on Jenkins)..
> 
> A flag within berks to ignore local cache would be ideal (like \`gem install\` has an option -r, -​-remote - Restrict operations to the REMOTE domain) http://guides.rubygems.org/command-reference/#gem-install
> 
> Cliff

If you are using supermarket, you also have to be aware that lock can come from that as well from one of it’s dependancies and chef ignore does not ignore it.

> <https://github.com/chef/chef/issues/2994>
>
> This seems to be a change from 11.X. Reported by @mcalb. To reproduce \[see comm…ent below, original comment deleted by @pburkholder since it was pretty unhelpful\]

Cliff

On 3/18/15, 12:06 PM, "Fouts, Chris" [Chris.Fouts@Sensus.com](mailto:Chris.Fouts@Sensus.com) wrote:

> Thanks.
> 
> I fixed my problem by deleting my ~/.berkshelf directory and starting over. How could I have fixed this without deleting ~/.berkshelf?
> 
> Chris
> 
> -----Original Message-----  
> From: Daniel DeLeo [[mailto:ddeleo@kallistec.com](mailto:ddeleo@kallistec.com)] On Behalf Of Daniel  
> DeLeo  
> Sent: Wednesday, March 18, 2015 12:00 PM  
> To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Re: Question regarding berks install
> 
> Are any of these cookbooks locked in an existing lockfile?
> 
> --  
> Daniel DeLeo
> 
> On Tuesday, March 17, 2015 at 10:29 AM, Fouts, Chris wrote:
> 
> > I have an environment cookbook, whose metadata.rb file looks like  
> > this
> > 
> > name ‘my\_env\_cookbook\_dev'  
> > (snip)  
> > version '0.1.0'
> > 
> > depends 'common', '= 1.2.0'
> > 
> > I have a Berksfile that looks like this
> > 
> > source "[https://supermarket.chef.io](https://supermarket.chef.io)"
> > 
> > metadata
> > 
> > # Community cookbooks
> > 
> > cookbook 'chef-client'  
> > cookbook 'powershell'  
> > cookbook 'push-jobs'
> > 
> > # Internal cookbooks
> > 
> > cookbook 'common', git: 'git@git-repo.domain.com ([mailto:git@git-repo.domain.com](mailto:git@git-repo.domain.com)):mycookbooks/common.git'
> > 
> > The metadata.rb file for the common cookbook in the git repo looks  
> > like
> > 
> > name ‘common’  
> > (snip)  
> > version '1.2.0'
> > 
> > When I do a berks install, I get
> > 
> > berks install  
> > Resolving cookbook dependencies...  
> > Fetching 'arqiva\_rni\_env\_dev' from source at .  
> > Fetching cookbook index from [https://supermarket.chef.io](https://supermarket.chef.io)...  
> > Unable to satisfy constraints on package common due to solution  
> > constraint (my\_env\_cookbook\_dev = 0.1.0). Solution constraints that  
> > may result in a constraint on common: [(my\_env\_cookbook\_dev = 0.1.0)  
> > -\> (common = 1.2.0)], [(common = 1.0.0)] Demand that cannot be met:  
> > (my\_env\_cookbook\_dev = 0.1.0) Artifacts for which there are  
> > conflicting dependencies: common = 1.0.0 -\> Unable to find a  
> > solution for demands: my\_env\_cookbook\_dev (0.1.0), build-essential  
> > (2.1.3), chef-client (4.2.4), chef\_handler (1.1.6), common (1.0.0),  
> > cron (1.6.1), logrotate (1.9.0), ms\_dotnet2 (1.0.0), ms\_dotnet4  
> > (1.0.2), ms\_dotnet45 (2.0.0), powershell (3.0.7), push-jobs (2.2.0),  
> > runit (1.5.18), windows (1.36.6), yum (3.5.3), yum-epel (0.6.0)
> > 
> > Where is the common v1.0.0 coming from?
> > 
> > Chris
