matschaffer / knife-solo

DEPRECATED: Please consider using https://knife-zero.github.io/, ansible, or visit https://www.chef.io/ for other ideas
MIT License
786 stars 213 forks source link

Could not satisfy version constraints for: chef-solo-search due to multiple versions #496

Open house9 opened 7 years ago

house9 commented 7 years ago

Similar to #397 I ran into an issue where an older version of 'chef-solo-search' was installed to cookbooks-1 but a newer version was installed to cookbooks-2. The newer version was a dependency of one of the cookbooks I was using sftp:

Running Chef on XXXX...
Installing Librarian cookbooks...
Uploading the kitchen...
Generating solo config...
Running Chef: sudo chef-solo -c ~/chef-solo/solo.rb -j ~/chef-solo/dna.json
Starting Chef Client, version 12.14.89
resolving cookbooks for run list: ["sftp::default"]
[2016-10-12T16:13:12+00:00] WARN: Child with name 'chef-solo-search' found in multiple directories: /home/ubuntu/chef-solo/cookbooks-1/chef-solo-search and /home/ubuntu/chef-solo/cookbooks-2/chef-solo-search
[2016-10-12T16:13:12+00:00] WARN: Child with name 'chef-solo-search' found in multiple directories: /home/ubuntu/chef-solo/cookbooks-1/chef-solo-search and /home/ubuntu/chef-solo/cookbooks-2/chef-solo-search
[2016-10-12T16:13:12+00:00] WARN: Child with name 'chef-solo-search' found in multiple directories: /home/ubuntu/chef-solo/cookbooks-1/chef-solo-search and /home/ubuntu/chef-solo/cookbooks-2/chef-solo-search
[2016-10-12T16:13:12+00:00] WARN: Child with name 'chef-solo-search' found in multiple directories: /home/ubuntu/chef-solo/cookbooks-1/chef-solo-search and /home/ubuntu/chef-solo/cookbooks-2/chef-solo-search
[2016-10-12T16:13:12+00:00] WARN: Child with name 'chef-solo-search' found in multiple directories: /home/ubuntu/chef-solo/cookbooks-1/chef-solo-search and /home/ubuntu/chef-solo/cookbooks-2/chef-solo-search

================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

Missing Cookbooks:
------------------
Could not satisfy version constraints for: chef-solo-search

Expanded Run List:
------------------
* sftp::default

Platform:
---------
x86_64-linux

Running handlers:
[2016-10-12T16:13:12+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-10-12T16:13:12+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 seconds
[2016-10-12T16:13:12+00:00] FATAL: Stacktrace dumped to /home/ubuntu/chef-solo/local-mode-cache/cache/chef-stacktrace.out
[2016-10-12T16:13:12+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-10-12T16:13:12+00:00] ERROR: 412 "Precondition Failed"
[2016-10-12T16:13:12+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.

The workaround:

My guess is that knife-solo requires chef-solo-search as the comment on cookbooks-1 is .../ruby/gems/2.3.0/gems/knife-solo-0.6.0/lib/knife-solo/resources/patch_cookbooks not sure if there is a way for knife-solo to not auto install chef-solo-search if it is already part of the included cookbooks?

matschaffer commented 7 years ago

No it's not switchable at the moment.

Probably wouldn't hurt to add a config guard on https://github.com/matschaffer/knife-solo/blob/master/lib/chef/knife/solo_cook.rb#L95 for it though.