[chef] Re: Re: Can't find any info on this error online: Failed to readthe private key /etc/chef/client.pem: #


Chronological Thread 
  • From: Jesse Nelson < >
  • To: chef < >
  • Subject: [chef] Re: Re: Can't find any info on this error online: Failed to readthe private key /etc/chef/client.pem: #<Errno::EACCES: Permission denied - /etc/chef/client.pem>
  • Date: Tue, 13 Nov 2012 00:28:23 +0900

You're running chef-client as the vagrant user and not root. It doesn't have permission to read the client key @ /etc/chef/client.pem


On Mon, Nov 12, 2012 at 11:41 PM, William Herry < " target="_blank"> > wrote:
seems like a permission issue, try `chown -R your-user-name /etc/chef`


On Mon, Nov 12, 2012 at 10:25 PM, Waldemar Schwan < " target="_blank"> > wrote:
Hi.

Let me start by saying: I'm new to chef :) . Now I'm getting this error, which I can't figure out :( .

Here is what I have done:

I used vagrant to create a new VM locally:

cat Vagrantfile 
Vagrant::Config.run do |config|
  config.vm.box = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"

  config.vm.network :hostonly, "33.33.33.20"
  config.vm.share_folder "v-root", "/vagrant", ".", :nfs => true
  config.ssh.forward_agent = true
  #config.vm.boot_mode = :gui
  config.vm.forward_port 80, 8080
end
and knife boostrap to initialize it

knife bootstrap 127.0.0.1 -p 2222 -E development-waldemarschwan -d adcloud -r "role[base]" --sudo -x vagrant -N platform-dev -i /Users/velrok/.vagrant.d/insecure_private_key
We have a base role in our company that installs the correct ruby version and a chef-client.
Up to this point everything is fine.

But when I connect to the instance via vagrant ssh and call chef-client I get the following error:

:~$ chef-client 
[2012-11-12T14:05:13+00:00] INFO: *** Chef 10.14.4 ***
[2012-11-12T14:05:13+00:00] WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::EACCES: Permission denied - /etc/chef/client.pem>

================================================================================
Chef encountered an error attempting to create the client "platform-dev-1352727376"
================================================================================

Private Key Not Found:
----------------------
Your private key could not be loaded. If the key file exists, ensure that it is
readable by chef-client.

Relevant Config Settings:
-------------------------
validation_key "/etc/chef/validation.pem"

/var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/file_cache.rb:56:in `initialize': Permission denied - /var/cache/chef/chef-stacktrace.out (Errno::EACCES)
from /var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/file_cache.rb:56:in `open'
from /var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/file_cache.rb:56:in `store'
from /var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/application.rb:144:in `debug_stacktrace'
from /var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/application/client.rb:314:in `rescue in block in run_application'
from /var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/application/client.rb:271:in `block in run_application'
from /var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/application/client.rb:270:in `loop'
from /var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/application/client.rb:270:in `run_application'
from /var/lib/gems/1.9.1/gems/chef-10.14.4/lib/chef/application.rb:70:in `run'
from /var/lib/gems/1.9.1/gems/chef-10.14.4/bin/chef-client:26:in `<top (required)>'
from /usr/local/bin/chef-client:23:in `load'
from /usr/local/bin/chef-client:23:in `<main>'
As far as I know it should not try to load any validation.pem.
Any thoughts / suggestions?

Any help is very much appreciated.

Best regards
Waldemar


-------------------------------------------------------------------------------------------------------

Waldemar Schwan · Software Engineer

Adcloud GmbH · Venloer Str. 25 · D-50672 Köln
Ein Unternehmen von Deutsche Post DHL

T +49 221 292 095 15 · F +49 221 292 095 99
" style="color:rgb(0,106,227)" target="_blank">  · www.adcloud.com

Handelsregister: Amtsgericht Köln, HRB 65770 · Sitz der Gesellschaft:
Köln · Geschäftsführer: Henning Lange, Oliver Thylmann






Archive powered by MHonArc 2.6.16.

§