euca2ools doesn't parse EC2_URL correctly

Bug #719547 reported by Andreas Hasenack
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
euca2ools
Fix Released
Undecided
Mitch Garnaat
euca2ools (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: euca2ools

The EC2_URL shell variable holds an URL to an EC2 or Eucalyptus endpoint.

There is a problem with the URL parsing code where, if said URL doesn't contain a port number, it thinks the whole URL is a hostname.

Example (with fake keys on purpose):

export EC2_URL="https://staging.landscape.canonical.com/cloud/ec2/landscape-devel/amra-uec/dev1"
export EC2_SECRET_KEY=1
export EC2_ACCESS_KEY=1

$ euca-describe-regions
(wait a long time).
[Errno -2] Name or service not known

Now change the EC2_URL so that is also includes the port number:
export EC2_URL="https://staging.landscape.canonical.com:443/cloud/ec2/landscape-devel/amra-uec/dev1"

And the expected answer comes right away:
$ euca-describe-regions
AuthFailure: No user with access key '1'

A packet sniffer shows that without the port number in the URL, euca2ools is trying to resolve the wrong hostname:
  0.000000 10.0.1.7 -> 10.0.1.1 DNS Standard query AAAA staging.landscape.canonical.com/cloud/ec2/landscape-devel/amra-uec/dev1
  0.009434 10.0.1.1 -> 10.0.1.7 DNS Standard query response, No such name
  0.028092 10.0.1.7 -> 10.0.1.1 DNS Standard query A staging.landscape.canonical.com/cloud/ec2/landscape-devel/amra-uec/dev1
  0.048702 10.0.1.1 -> 10.0.1.7 DNS Standard query response, No such name

I tried with both euca2ools 1.2-0ubuntu10.1 from lucid and 1.3.1-0ubuntu5 from natty.

Scott Moser (smoser)
Changed in euca2ools (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Mitch Garnaat (mitch-garnaat) wrote :

I believe this is fixed in the latest code which uses urlparse to split the URL rather than doing things manually.

Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 719547] Re: euca2ools doesn't parse EC2_URL correctly

On Thu, 17 Feb 2011, Mitch Garnaat wrote:

> I believe this is fixed in the latest code which uses urlparse to split
> the URL rather than doing things manually.

I think you're right. I saw the urlparse patch, but due to just reading
the patch thought it only applied to S3_URL, not EC2_URL.

I'll try cherry-picking the urlparse changes back to ubuntu.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package euca2ools - 1.3.1-0ubuntu6

---------------
euca2ools (1.3.1-0ubuntu6) natty; urgency=low

  * use 0.0.0.0/0 as default source-subnet in euca-revoke and
    euca-authorize (LP: #725170)
  * parse EC2_URL correctly if it does not contain a port (LP: #719547)
  * provide symlink from euca-authorize-group to euca-authorize-groups
    for better drop-in replacement of ec2-api-tools. (LP: #720856)
 -- Scott Moser <email address hidden> Fri, 25 Feb 2011 15:34:45 -0500

Changed in euca2ools (Ubuntu):
status: Triaged → Fix Released
Changed in euca2ools:
assignee: nobody → Mitch Garnaat (mitch-garnaat)
status: New → Fix Committed
Changed in euca2ools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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