Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to satisfy constraints on package due to solution constraint #1515

Closed
ghost opened this issue Feb 18, 2016 · 4 comments
Closed

Unable to satisfy constraints on package due to solution constraint #1515

ghost opened this issue Feb 18, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 18, 2016

I have an issue with Berkshelf that I just cannot resolve.

I have a wrapper cookbook, acmecorp_consul with the following solution constraints in metadata.rb (I've renamed the prefix to the placeholder acmecorp for the posting of posting this issue):

depends 'consul', '~> 1.4.3'
depends 'consul-template', '~> 0.9.4'
depends 'sudo', '~> 2.7.2'

whose versions are defined in the Berksfile:

cookbook 'consul', '~> 1.4.3', git: 'git@github.com:johnbellone/consul-cookbook.git'
cookbook 'consul-template', '~> 0.9.4', git: 'git@github.com:adamkrone/chef-consul-template.git'

In addition, I have a second cookbook whose sole dependency is acmecorp_consul:

depends 'acmecorp_consul', '~> 0.1.15'

with the following definition in the Berksfile:

cookbook 'acmecorp_consul', '~> 0.1.15', :git => 'git@github.com:acmecorp/consul-cookbook.git'

However, when I run berks install I get the following error:

Unable to satisfy constraints on package consul-template due to solution constraint (acmecorp_consul = 0.1.15). Solution constraints that may result in a constraint on consul-template: [(acmecorp_consul = 0.1.15) -> (consul-template ~> 0.9.4)], [(test_cookbook = 0.0.1) -> (acmecorp_consul = 0.1.15) -> (consul-template ~> 0.9.4)]
Demand that cannot be met: (acmecorp_consul = 0.1.15)
Artifacts for which there are conflicting dependencies: consul-template = 0.7.0 -> [(ark >= 0.0.0), (golang ~> 1.4.0), (runit >= 0.0.0)]Unable to find a solution for demands: acmecorp_consul (0.1.15), test_cookbook (0.0.1)

However, I see no dependency on consul-template 0.7.0 in any of the Berksfile.lock files. What could be the issue here?

@Sauraus
Copy link

Sauraus commented Oct 5, 2016

Looks like you are looking for this: chef/dep-selector-libgecode#43

@nozpheratu
Copy link

I'm running into this precise issue... it's driving me nuts!

@nozpheratu
Copy link

The "fix" that worked for me was to be as explicit as possible with version dependencies and to mirror the failing dependency in the 2nd cookbook. E.g., in the second cookbook you would have:

cookbook 'consul-template', '~> 0.9.4', git: 'git@github.com:adamkrone/chef-consul-template.git'
cookbook 'acmecorp_consul', '~> 0.1.15', :git => 'git@github.com:acmecorp/consul-cookbook.git'

The dependency solver needs to be spoon fed.

@lamont-granquist
Copy link
Contributor

this is the transitive deps issue, it will likely never be fixed in berkshelf

@berkshelf berkshelf locked and limited conversation to collaborators Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants