vagrant-digitalocean: SSH key allready exists gettig error
Hi, My SSH public key was allrady added on my digital ocean account. I got following error
agrant up --provider=digital_ocean
Bringing machine 'default' up with 'digital_ocean' provider...
==> default: Creating new SSH key: Vagrant...
There was an issue with the request made to the Digital Ocean
API at:
Path: /v2/account/keys
URI Params: {:name=>"Vagrant", :public_key=>"ssh-rsa XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}
The response status from the API was:
Status: 422
Response: {"id"=>"unprocessable_entity", "message"=>"Ssh key SSH Key is already in use on your account"}
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 19
+1
I was experiencing the same problem. The fix was to use the same name that was registered on Digital Ocean for the specified key.
provider.ssh_key_name = ‘Same key name as in DO’
I keep running into the same issue. I’ve tried and double-checked check every solution documented. What’s very odd is that this started happening suddenly, it was all working fine until it wasn’t. I’ve rolled back code, changed keys, add new keys… i don’t know what to do anymore
Update: I added a new key and specified it in the
provider.ssh_key_name = 'My New Key Name'and it started working. I also deleted the .vagrant directory just in case and started vagrant withvagrant up provider=digital_oceanThe solution is to make sure the key names match:
See #223 for details.