More SSH keypair problems on rubber:create

56 views
Skip to first unread message

Brian Del Vecchio

unread,
Oct 7, 2009, 2:25:38 PM10/7/09
to rubber
I managed to get through this before, but today I'm hitting a wall.
The specific error I'm encountering is:

** Creating instance ami-ed46a784/m1.small/
default,web,spork,haproxy,app,passenger,apache,db,mysql_master/Default
/opt/local/lib/ruby/gems/1.8/gems/amazon-ec2-0.5.5/lib/AWS.rb:282:in
`aws_error?': The key pair 'spork-staging' does not exist
(AWS::InvalidKeyPairNotFound)

while my rubber.yml is pretty explicit:

key_name: spork-staging
key_file: "/Users/bdv/.ec2/spork-staging"

and the key files look right:

rusty:.ec2 bdv$ ls -l ~/.ec2
-rw-------@ 1 bdv bdv 1693 Oct 7 13:30 spork-staging
-rw-r--r-- 1 bdv bdv 381 Oct 7 13:32 spork-staging.pub

The file 'spork-staging' was downloaded during the EC2 Instance
creation, and the public key was generated from that one using "ssh-
keygen -y -f"


Any ideas what I'm doing wrong?

Thanks,
Brian Del Vecchio

Matthew Conway

unread,
Oct 7, 2009, 2:40:15 PM10/7/09
to rubbe...@googlegroups.com
Hard to say - looks like you are doing everything right.

I think it might be because you have a different KeyPair name locally
than what AWS thinks it is. Use something like elasticfox or the aws
ec2 web console to verify that you do indeed have a KeyPair named
'spork-staging' - the name in AWS needs to match the key_name in
rubber.yml. AWS basically uses the keypair *name* you use when
creating an instance to look up the private/public key and add it to
the instance so you can ssh in. So rubber simply passes the *name* to
AWS create instance, and then assumes the ssh key file you give it
matches that keyname, and uses it to try and ssh in.

If that doesn't help, what version of rubber are you using? If its >=
1.0, there was some changing of variable names in rubber.yml, so old
files might not have the right naming for the new rubber.

Matt

Brian Del Vecchio

unread,
Oct 7, 2009, 3:09:53 PM10/7/09
to rubbe...@googlegroups.com
OK, I bet it's because I renamed the file. Thanks for the help, Matt!

Brian Del Vecchio | 617-899-0798 | @hybernaut

On Oct 7, 2009, at 2:40 PM, Matthew Conway <ma...@conwaysplace.com>
wrote:

Brian Del Vecchio

unread,
Oct 7, 2009, 4:05:10 PM10/7/09
to rubbe...@googlegroups.com
The problem turned out to be that I was using the Access Key from a different account where the EC2 Keypair was registered.  I'm going to add a rubber recipe for displaying/verifying the keypairs to help people track down these problems in the future.

Thanks again for your help, Matt!

Brian Del Vecchio  |  b...@hybernaut.com  |  @hybernaut


Reply all
Reply to author
Forward
0 new messages