Failed to get metadata for ip (list indices must be integers...)

Bug #803705 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Dan Prince

Bug Description

Using nova bzr 1230.

When booting an AMI style image I'm getting the following error messages in nova-api.log:

2011-06-30 00:44:08,654 INFO nova.api [-] 0.23553s 192.168.0.2 GET /2009-04-04/meta-data/instance-id None:None 500 [Wget] text/plain text/plain
2011-06-30 00:44:08,755 ERROR nova.api.ec2.metadata [-] Failed to get metadata for ip: 192.168.0.2
(nova.api.ec2.metadata): TRACE: Traceback (most recent call last):
(nova.api.ec2.metadata): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/ec2/metadatarequesthandler.py", line 76, in __call__
(nova.api.ec2.metadata): TRACE: meta_data = cc.get_metadata(remote_address)
(nova.api.ec2.metadata): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/ec2/cloud.py", line 155, in get_metadata
(nova.api.ec2.metadata): TRACE: instance_ref = db.instance_get(ctxt, instance_ref['id'])
(nova.api.ec2.metadata): TRACE: TypeError: list indices must be integers, not str
(nova.api.ec2.metadata): TRACE:
2011-06-30 00:44:08,756 INFO nova.api [-] 0.24947s 192.168.0.2 GET /2009-04-04/meta-data/public-ipv4 None:None 500 [Wget] text/plain text/plain

Related branches

Revision history for this message
Dan Prince (dan-prince) wrote :

According to SmokeStack revision 1230 was the breaking change.

The effect here is that AMI style instances will boot but won't get there SSH keys, etc.

I'm using Postgres but I don't think that matters.

Changed in nova:
importance: Undecided → High
Dan Prince (dan-prince)
Changed in nova:
status: New → In Progress
assignee: nobody → Dan Prince (dan-prince)
Revision history for this message
Dan Prince (dan-prince) wrote :

Looks like the issue here was that the compute API get_all call now returns a list even if there is just a single record. The metadata controller call just needs to access the first item in the list.

Dan Prince (dan-prince)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-3
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-3 → 2011.3
status: Fix Committed → 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.