applicationsonline / librarian

Librarian - A Framework for Bundlers. Librarian-Chef is at: https://github.com/applicationsonline/librarian-chef.
http://applicationsonline.com/
MIT License
654 stars 71 forks source link

Cookbook conflict causes infinite loop #117

Closed dkingofpa closed 11 years ago

dkingofpa commented 11 years ago

Using 0.0.25, I'm running librarian-chef install --verbose with this Cheffile. I'm getting a conflict with the mysql cookbook which appears to be causing an infinite loop. It just keeps checking the aws cookbook and then trying to resolve mysql. Here's a snippet of the output:

[Librarian] Checking manifests
[Librarian] Checking aws/0.100.2 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.100.2 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.100.0 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.100.0 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.99.1 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.99.1 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.99.0 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.99.0 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.10.1 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.10.1 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.10.0 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.10.0 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.9.0 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.9.0 <http://community.opscode.com/api/v1>
[Librarian] Failed to resolve aws (>= 0.0.0) <#<Librarian::Resolver::Implementation::MultiSource:0x007fa4a292d5f8>>
[Librarian] Backtracking from xml/1.0.4 <http://community.opscode.com/api/v1>
[Librarian] Checking xml/1.0.2 <http://community.opscode.com/api/v1>
[Librarian] Resolving aws (>= 0.0.0) <#<Librarian::Resolver::Implementation::MultiSource:0x007fa4a292d5f8>>
[Librarian] No known prior constraints
[Librarian] Checking manifests
[Librarian] Checking aws/0.100.2 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.100.2 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.100.0 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.100.0 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.99.1 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.99.1 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.99.0 <http://community.opscode.com/api/v1>
[Librarian] Resolving mysql (>= 1.3.0) <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Conflicts with mysql/1.2.4 <git://github.com/xforty/chef-mysql.git#xforty>
[Librarian] Backtracking from aws/0.99.0 <http://community.opscode.com/api/v1>
[Librarian] Checking aws/0.10.1 <http://community.opscode.com/api/v1>
yfeldblum commented 11 years ago

It appears to be the resolver trying all possible combinations of all cookbooks in order, looking for a consistent resolution (yes we can improve this). You may want to find out what's depending on mysql >= 1.3.0 though, or use a mysql cookbook marked as 1.3.0 or higher.

dkingofpa commented 11 years ago

Librarian was running for over ten minutes so I had to ctrl-c it. As soon as it finds a cookbook conflict, perhaps it can just fail fast?

Opscode's database cookbook bumped it's mysql cookbook dependency to >= 1.3.0. I resolved that issue and librarian ran fine.

yfeldblum commented 11 years ago

I would like to improve the dependency resolver. But for now, glad to hear you've worked around it.

yfeldblum commented 11 years ago

I've made some changes to the resolver. If you can still reproduce the problem with librarian-v0.0.25, mind giving it a try with master >= 0019611?

dkingofpa commented 11 years ago

Sure, I'm still able to reproduce the issue with an older version of my project and librarian-v0.0.25:

git clone git@github.com:xforty/vagrant-drupal.git
cd vagrant-drupal
git checkout 0.4.0
rm Cheffile.lock
librarian-chef install --verbose

Problem reproduced...keeps trying all possible cookbook combinations.

I then cloned librarian's master branch (HEAD currently at SHA 34eaa6b4ed) and ran it using the instructions from your readme:

rm -rf tmp
git clone git://github.com/applicationsonline/librarian.git
librarian/bin/librarian-chef install --verbose

Appears like that fixed it. Here's the output: https://gist.github.com/4159026

yfeldblum commented 11 years ago

Fantastic. Thanks!