euca-import-keypair does not work

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

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
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: euca2ools
UpgradeStatus: Upgraded to precise on 2011-11-07 (37 days ago)

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
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)
summary: - euca-import-keypair does not work to EC2
+ euca-import-keypair does not work
Scott Moser (smoser)
tags: removed: running-unity
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in euca2ools (Ubuntu):
status: New → Confirmed
Revision history for this message
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/connection.py the public_key_material is base64 encoded, i checked by printing the value of the variable.

Revision history for this message
Scott Moser (smoser) wrote :

@Bastian,
 Right. The merge proposal attached has the fix.
  https://review.openstack.org/2389

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

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

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

Revision history for this message
Bastian Gebhardt (buzz-t) wrote :

Too late, too late... :)

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

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch of /usr/share/pyshared/euca2ools/commands/euca/importkeypair.py" 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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.