Chef 11 Hangs Trying to Deal With Unresolvable Dependencies

Page content

Recently hit the problem with Chef server 11.0.12-1.ubuntu.12.04 trying to test updates for OpenStack StackForge cookbooks. stable/havana cookbooks depend on the cookbook openstack-common ~> 8.0, stable/icehouse depend on the cookbook openstack-common ~> 9.0

So in general if you mix cookbooks from stable/havana and stable/icehouse branches on your Chef server for testing purpose (as I did), these dependencies will be unresolvable simultaneously.

When chef-client from some node queries Chef server to resolve dependencies and send cookbooks for execution this leeds to the load spike on the Chef server, beam.smp process(es) start to consume lot of CPU time. Chef-client -l debug shows that the client is waiting for reply to the POST /environments/foo/cookbook_versions request.

The problem is with depsolver in Chef 11.0, here is a bug. You should be able to resolve the issue by upgrading Chef server to 11.1:

{% blockquote Chef documentation https://github.com/opscode/omnibus-chef-server/blob/11.1.0/CHANGELOG.md Changelog for 11.1.0 %} Change back to gecode depsolver

With the 11.0 release, Chef server changed depsolvers from gecode to an all erlang depsolver. The idea behind this was to drop the heavy nature of gecode, which has a considerable build time and large binary to ship. However, the experience of switching taught us that our erlang solution was not robust enough to solve all the dependencies that gecode could and that Chef users needed. Therefore with this release the depsolver switches back to using gecode. This switch should be transparent, but in some cases cookbook dependency resolution that was previously failing should work again.

The change in depsolvers is accomplished through changes to the repo chef_objects and these changes are pulled in by the updated erchef. {% endblockquote %}