Skip to content

Instantly share code, notes, and snippets.

@brookemckim
Created May 12, 2011 20:48
Show Gist options
  • Save brookemckim/969415 to your computer and use it in GitHub Desktop.
Save brookemckim/969415 to your computer and use it in GitHub Desktop.
Chef::Exceptions::PrivateKeyMissing
[Thu, 12 May 2011 16:46:45 -0400] WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/client.pem>
[Thu, 12 May 2011 16:46:45 -0400] ERROR: Running exception handlers
[Thu, 12 May 2011 16:46:45 -0400] ERROR: Exception handlers complete
[Thu, 12 May 2011 16:46:45 -0400] FATAL: Stacktrace dumped to /tmp/chef-stacktrace.out
[Thu, 12 May 2011 16:46:45 -0400] FATAL: Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/client.pem, which you told me to use to sign requests!
# chef-solo -c /etc/chef/solo.rb -j /etc/chef/dna.json
file_cache_path "/tmp"
cookbook_path ["/tmp/chef-solo/cookbooks", "/tmp/chef-solo/site_cookbooks"]
role_path "/tmp/chef-solo/roles"
log_level :info
log_location STDOUT
ssl_verify_mode :verify_none
@mconigliaro
Copy link

is this with the lucid64 vagrant box? did you ever figure out what's going on here?

@txm
Copy link

txm commented Nov 5, 2011

remove the environment line

@mconigliaro
Copy link

No, I figured it out. If your cookbooks do searches or need any kind of interaction with a chef server, chef-solo will behave like a regular chef client (requiring client registration, etc.). This is why it's complaining about the missing private key.

@txm
Copy link

txm commented Nov 6, 2011

Ah, thanks, that fits with my version of the error and the environment line being specified.

@volkanunsal
Copy link

Can someone tell me how to fix this? I am getting the exact same error. Do I change the environment line??

@Htbaa
Copy link

Htbaa commented Feb 21, 2014

I had to install http://community.opscode.com/cookbooks/chef-solo-search to fix this problem.

@justizin
Copy link

Changing the provisioner from chef_solo to chef_zero should also do it, but if your cookbook fails without data bags, you need to define them statically. The nagios cookbook has a pretty good example of this.

@mayurpatankar
Copy link

I was getting the same error then running as sudo helped me here

[2020-06-01T08:43:57+00:00] FATAL: Stacktrace dumped to /home/ec2-user/.chef/cache/chef-stacktrace.out
[2020-06-01T08:43:57+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-06-01T08:43:57+00:00] FATAL: Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/client.pem, which you told me to use to sign requests!
[ec2-user@client chef]$ chmod 600 client.pem
chmod: changing permissions of ‘client.pem’: Operation not permitted
[ec2-user@client chef]$ sudo chef-client
Starting Chef Infra Client, version 15.11.3
resolving cookbooks for run list: ["starter"]
Synchronizing Cookbooks:

  • starter (1.0.0)
    Installing Cookbook Gems:
    Compiling Cookbooks...
    Converging 1 resources
    Recipe: starter::default
  • log[Welcome to Chef, Sam Doe!] action write

Running handlers:
Running handlers complete
Chef Infra Client finished, 1/1 resources updated in 05 seconds
[ec2-user@client chef]$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment