Skip to end of metadata
Go to start of metadata



Chef-client needs to run with elevated privileges to get most recipes to converge correctly.

On Unix and Unix-like operating systems this is done by running the command as root.
On Windows this is done by running command prompt as administrator.



Linux


On Linux, you may see this error if you do not have the correct permissions to run chef-client:

You can resolve this by running the command as root. There are a few ways you can accomplish this:

  • Logging in as root and running chef-client
  • Using su to become the root user and running chef-client:
  • Using the sudo utility

You could also resolve this by giving your user access to read /etc/chef and the files accessed by chef-client, but this is not advised as most recipes will need super user privileges to complete correctly.

Windows


In Windows, this issue normally fails silently. It appears that chef-client converged correctly, but when you go to check the changes they have not been made.

If you see this occur, follow one of these options to run chef-client as administrator and see if this resolves the issue.

  • Login into the Administrator account. NOTE: This is different than an account in the Administrator's group.
  • Run the chef-client process from the Administrator account while being logged into another account (you will be prompted for your Administrator password). You can do this by entering this command into a command prompt window:
  • Open a command prompt using UAC by right clicking on command prompt and selecting 'run as administrator':

Once the command prompt is open, you can run chef-client. Keep in mind that you will need to provide the full path to the client.rb as the current working directory will now be the Administrator's home directory. You can do this with a command such as chef-client -c C:\chef\client.rb.







Installation


Managing Chef



Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.