Default api-paste.ini does not properly route metadata requests to /1.0

Bug #948595 reported by Adam Gandelman
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Adam Gandelman
nova (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Requests that are routed to the metadata url return a list of supported metadata endpoints:

'1.0',
'2007-01-19',
'2007-03-01',
'2007-08-29',
'2007-10-10',
'2007-12-15',
'2008-02-01',
'2008-09-01',
'2009-04-04',

However, all but /1.0/ is configured in the default api-paste.ini metadata url mapping, resulting in requests to /1.0/ just returning another dump of the supported versions.

root@server-22:/var/lib/cloud/instance# curl 169.254.169.254/1.0/
1.0
2007-01-19
2007-03-01
2007-08-29
2007-10-10
2007-12-15
2008-02-01
2008-09-01
2009-04-04
root@server-22:/var/lib/cloud/instance# curl 169.254.169.254/1.0/1.0/
1.0
2007-01-19
2007-03-01
2007-08-29
2007-10-10
2007-12-15
2008-02-01
2008-09-01
2009-04-04

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/5003

Changed in nova:
assignee: nobody → Adam Gandelman (gandelman-a)
status: New → In Progress
Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

Is the bug that 1.0 doesn't route anywhere or that 1.0 is in the list in the first place? I can't find any documentation on what a 1.0 API should be.

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Johannes- The bug is that it does not route anywhere. AFAICS, its in the list (with the rest of the versions reported) to maintain ec2 compatibility. In fat, I came across the issue when testing a tool designed for EC2 on nova.

On EC2, for example:

adam@ath0:~$ curl http://169.254.169.254/
1.0
2007-01-19
2007-03-01
2007-08-29
2007-10-10
2007-12-15
2008-02-01
2008-09-01
2009-04-04
2011-01-01
2011-05-01
latest
adam@ath0:~$ curl http://169.254.169.254/1.0/
meta-data
user-data
adam@ath0:~$ curl http://169.254.169.254/1.0/meta-data/
ami-id
ami-launch-index
ami-manifest-path
hostname
instance-id
local-ipv4
public-keys/
reservation-id
security-groups
adam@ath0:~$

Dave Walker (davewalker)
Changed in nova (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

The reason why I ask is because I don't even see a 1.0 EC2 API doc anywhere. It's not listed here:

http://aws.amazon.com/archives/Amazon-EC2

and the latest version isn't 1.0. All of the versions fit YYYY-mm-dd format so 1.0 seems like it's a mistake not supposed to be in the list.

I'm not an expert on the EC2 API but to me it looks like the inclusion in the list is a mistake and not the absence in the paste config.

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

Ok, I missed that you testes EC2 itself and saw 1.0 on there

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/5003
Committed: http://github.com/openstack/nova/commit/b8f22627e477e32dc278168f0e73f0b599d93ee4
Submitter: Jenkins
Branch: master

commit b8f22627e477e32dc278168f0e73f0b599d93ee4
Author: Adam Gandelman <email address hidden>
Date: Tue Mar 6 16:28:44 2012 -0800

    api-paste.ini: Add /1.0 to default urlmap

    The metadata handler lists 1.0 as a supported version, but there is no
    mapping for /1.0 to the meta pipeline in the default paste config, resulting
    in requests to 169.254.169.254/1.0/ re-serving the metaversions pipeline instead.

    Fixes bug 948595

    Change-Id: Ib9cb54a04170ad86bbcbbb59557be97f05de13f9

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in nova (Ubuntu):
status: New → Confirmed
Changed in nova (Ubuntu):
status: Confirmed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-rc1 → 2012.1
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.