chamilad
chamilad

Reputation: 1669

Chef - unable to solve dependencies in alotted time

When I run chef-client the execution sometimes fail with this error and "Preconditions failed" message.

The first time it came I deleted the older versions of cookbooks I had in the server and it fixed this. However I still get this, intermittently.

What is the exact cause that produces this result?

Upvotes: 2

Views: 2888

Answers (1)

coderanger
coderanger

Reputation: 54267

This happens because the server has a fixed number of depsolver workers, and each of those has a timeout on a single solver attempt. You probably want to increase the number of workers in your chef-server.rb config.

The property you are looking for is opscode_erchef['depsolver_worker_count']. The default value is 5. To increase it:

  1. SSH into the Chef Server
  2. Open the (possibly empty) file at /etc/chef-server/chef-server.rb
  3. Add the line opscode_erchef['depsolver_worker_count'] = x (where x is the value you want to use. Should be greater than 5). Save and close the file.
  4. Run chef-server-ctl reconfigure

After setting the value sufficiently high (e.g. to 30), you may still find that this issue persists. In that event, repeat steps 1 and 2 above, and add the line opscode_erchef['depsolver_timeout'] = x (where x is the amount of time, in milliseconds, before timing out. Default is 5000. I, personally, use 30000). Then repeat step 4 as well.

Upvotes: 3

Related Questions