euca-import-keypair does not work

Bug #904739 reported by Scott Moser on 2011-12-15
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Status tracked in Devel
Fix Released
Fix Released
euca2ools (Ubuntu)

Bug Description

$ euca-import-keypair --region sa-east-1 ~/.<email address hidden> brickies
These required options are missing: public-key-file

$ cat ~/.<email address hidden>
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3I7VUf2l5gSn5uavROsc5HRDpZdQueUq5ozemNSj8T7enqKHOEaFoU2VoPgGEWC9RyzSQVeyD6s7APMcE82EtmW4skVEgEGSbDc1pvxzxtchBj78hJP6Cf5TCMFSXw+Fz5rF1dR23QDbN1mkHs7adr8GW4kSWqU7Q7NDwfIrJJtO7Hi42GyXtvEONHbiRPOe8stqUly7MvUoN+5kfjBM8Qqpfl2+FNhTYWpMfYdPUnE7u536WqzFmsaqJctz3gBxH9Ex7dFtrxR4qiqEr9Qtlu3xGn7Bw07/+i1D+ey3ONkZLN+LQ714cgj8fRS4Hj29SCmXp5Kt5/82cD/VN3NtHw== smoser@brickies

$ ec2-import-keypair --region sa-east-1 --public-key-file ~/.<email address hidden> brickies
KEYPAIR brickies e5:3d:58:88:e8:85:9e:aa:08:bf:19:cd:91:44:09:98

Ie, the key worked fine when uploaded with ec2-api-tools, but not with euca2ools.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: euca2ools 2.0.0~bzr495-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-4.10-generic 3.2.0-rc5
Uname: Linux 3.2.0-4-generic x86_64
ApportVersion: 1.90-0ubuntu1
Architecture: amd64
Date: Thu Dec 15 08:14:32 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
PackageArchitecture: all
 PATH=(custom, user)
SourcePackage: euca2ools
UpgradeStatus: Upgraded to precise on 2011-11-07 (37 days ago)

Related branches

Scott Moser (smoser) wrote :
Scott Moser (smoser) wrote :

looking at the attachments from the previous mail, its fairly clear that euca2ools is doing something bogus with PublicKeyMaterial as it is way too short.

Scott Moser (smoser) on 2011-12-15
summary: - euca-import-keypair does not work to EC2
+ euca-import-keypair does not work
Scott Moser (smoser) on 2011-12-15
tags: removed: running-unity
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in euca2ools (Ubuntu):
status: New → Confirmed
Bastian Gebhardt (buzz-t) wrote :

i got the error. I sniffed the transfered traffic (to an non-cloud http server) and noticed that the transferred public_key_material is the base64 encoded _filename_ of the public key, not the base64 encoded _content_ of the file.

In the method "import_key_pair(self, key_name, public_key_material)" in the file /usr/share/pyshared/boto/ec2/ the public_key_material is base64 encoded, i checked by printing the value of the variable.

Scott Moser (smoser) wrote :

 Right. The merge proposal attached has the fix.

  Feel free to +1 it if it works for you.

Scott Moser (smoser) wrote :
Changed in euca2ools:
status: New → Confirmed
Changed in euca2ools (Ubuntu):
importance: Undecided → Medium
Bastian Gebhardt (buzz-t) wrote :

I wrote a patch of /usr/share/pyshared/euca2ools/commands/euca/ and attached it. Works for me.

Bastian Gebhardt (buzz-t) wrote :

Too late, too late... :)

But my patch is derived from the file in the same folder, so maybe it's more unified.

The attachment "Patch of /usr/share/pyshared/euca2ools/commands/euca/" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package euca2ools - 2.0.0~bzr516-0ubuntu3

euca2ools (2.0.0~bzr516-0ubuntu3) precise; urgency=low

  * debian/patches/import-keypair-fix-import.patch: fix
    import-keypair to use content of filename, not filename (LP: #904739)
 -- Scott Moser <email address hidden> Thu, 22 Mar 2012 12:11:38 -0400

Changed in euca2ools (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers