Hosted Chef, Vagrant and ‘There may already be a client named “vagrant.vm”‘…

I’ve been playing around with Chef again this afternoon, and ran into a problem after following the (very useful) Opscode tutorials and then experimenting on my own

The Problem

localhost ==============================================================
localhost
localhost Chef encountered an error attempting to create the client "vagrant.vm"
localhost
localhost ==============================================================
localhost
localhost
localhost
localhost
localhost Authorization Error:
localhost
localhost --------------------
localhost
localhost Your validation client is not authorized to create the client for this node (HTTP 403).
localhost
localhost
localhost
localhost
localhost
localhost
localhost Possible Causes:
localhost
localhost ----------------
localhost
localhost * There may already be a client named "vagrant.vm"
localhost
localhost * Your validation client (xxxxxx-validator) may have misconfigured authorization permissions.
localhost

It’s quite obvious that my earlier tutorial-based activities had registered the ‘vagrant.vm’ node name with my hosted Chef. Accordingly I visited my Hosted Chef portal and removed the node, but after receiving confirmation of the node being deleted I was still getting the same error when attempting to provision my local vm box.

Solution

Give the second Vagrant node a new name when bootstrapping e.g.

$ knife bootstrap localhost \
 --ssh-user vagrant \
 --ssh-password vagrant \
 --ssh-port 2222 \
 --run-list "recipe[apt]" \
 --sudo \
 --node-name "vagrant.vm2"

Alternatively you can delete the first node you created via knife on the CLI (rather than attempting to delete the node via the web-based Hosted Chef interface):

$ knife node delete "vagrant.vm"
4 comments
  1. Ryan said:

    tried the ‘knife node delete “vagrant.vm”‘ doesnt work. it says

    ERROR: The object you are looking for could not be found
    Response: node ‘vagrant.vm’ not found

    • “vagrant.vm” should be the name of the VM you created? Did you name it something different? If so try to substitute the name you used for this.

      • Casey said:

        You probably also have to do a “knife client delete vagrant.vm”. You can run “knife client list” first to see if it is listed there.

      • Thanks Casey! Very interesting

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: