Removing a knife client without a private key?

I joined the new company and, to get into speed, I played with Vagrant for my virtual machine. I had an almost-tuned system, and then a strange error made me disconnect the laptop without shutting it off via vagrant destroy . Now, trying to install set, I run vagrant up and get the following error message.

  [default] Running provisioner: Vagrant::Provisioners::ChefClient... [default] Creating folder to hold client key... [default] Uploading chef client validation key... [default] Generating chef JSON and uploading... [default] Running chef-client... stdin: is not a tty [Wed, 16 Jan 2013 05:20:20 -0500] INFO: *** Chef 0.10.2 *** [Wed, 16 Jan 2013 05:20:20 -0500] INFO: Client key /etc/chef/client.pem is not present - registering [Wed, 16 Jan 2013 05:20:21 -0500] INFO: HTTP Request Returned 409 Conflict: Client already exists. [Wed, 16 Jan 2013 05:20:22 -0500] INFO: HTTP Request Returned 403 Forbidden: Merb::ControllerExceptions::Forbidden [Wed, 16 Jan 2013 05:20:22 -0500] FATAL: Stacktrace dumped to /srv/chef/file_store/chef-stacktrace.out [Wed, 16 Jan 2013 05:20:22 -0500] FATAL: Net::HTTPServerException: 403 "Forbidden" The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! chef-client -c /tmp/vagrant-chef-1/client.rb -j /tmp/vagrant-chef-1/dna.json 

Now, from my own research, I see that this means that the client already exists with the specified name, so I decided to manually disable it. I tried to list all clients with a knife client list , but then received the following message:

  WARNING: No knife configuration file found ERROR: Your private key could not be loaded from /etc/chef/client.pem Check your configuration file and ensure that your private key is readable 

It’s strange. I know that knife.rb exists, I see this when I ls , so I don’t know how the knife configuration file could not exist. Apparently, I do not see clients of my knife without this private key. I am completely new to Vagrant, Knife and Chef, so I'm at a dead end.

Thoughts?

+4
source share
1 answer

Thus, the convention is that your knife.rb is located in ~/.chef/knife.rb or /etc/chef/knife.rb - I prefer the first one, since it stores it in my home folder and it is limited to the account user record MY.

I will also usually keep the Chef Server client certificate.

Once you can successfully complete the knife client list , you can identify and remove the certificate of the abusive client. (You may also be able to use the web interface in the meantime).

When the firewall removed the client certificate of destruction, there was a proposed feature , but was not implemented, leaving it to the operator to make this decision.

Also, it looks like you are using a VERY old version of Chef - 0.10.2 - and we have just released 10.18.2. Something to consider.

+1
source

All Articles