XML serialization fails when it's trying to serialize an empty selector
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Andrea Rosa |
Bug Description
The XML serilaziation is failing when it's trying to create a datum selector with no values.
It's possible to use devstack to reproduce this issue following these steps:
- boot an instance from volume without specifying an image id:
nova boot --flavor 1 --block-
- perform a GET servers for the instance created in the previous step requiring the results in XML:
curl -i http://
-H "X-Auth-Project-Id: admin" -H "Accept: application/xml" -H "X-Auth-Token: <TOKEN>"
The response is a 500 error:
HTTP/1.1 500 Internal Server Error
Content-Length: 192
Content-Type: application/xml; charset=UTF-8
X-Compute-
Date: Tue, 10 Sep 2013 13:43:30 GMT
<computeFault code="500" xmlns="http://
And in the compute log you can find details of the exception:
2013-09-10 13:43:30.729 ERROR nova.api.openstack [req-5f69cdc2-
2013-09-10 13:43:30.729 TRACE nova.api.openstack Traceback (most recent call last):
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack return req.get_
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/local/
2013-09-10 13:43:30.729 TRACE nova.api.openstack application, catch_exc_
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/local/
2013-09-10 13:43:30.729 TRACE nova.api.openstack app_iter = application(
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/local/
2013-09-10 13:43:30.729 TRACE nova.api.openstack return resp(environ, start_response)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack return self.app(env, start_response)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/local/
2013-09-10 13:43:30.729 TRACE nova.api.openstack return resp(environ, start_response)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/local/
2013-09-10 13:43:30.729 TRACE nova.api.openstack return resp(environ, start_response)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/lib/
2013-09-10 13:43:30.729 TRACE nova.api.openstack response = self.app(environ, start_response)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/local/
2013-09-10 13:43:30.729 TRACE nova.api.openstack return resp(environ, start_response)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/local/
2013-09-10 13:43:30.729 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/usr/local/
2013-09-10 13:43:30.729 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack content_type, body, accept)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack self.default_
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack response.body = serializer.
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack elem = self.make_tree(obj)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack return self._serialize
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack self._serialize
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack elems = siblings[
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack elems.append(
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack self.apply(elem, datum)
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack elem.set(key, unicode(value(obj, True)))
2013-09-10 13:43:30.729 TRACE nova.api.openstack File "/opt/stack/
2013-09-10 13:43:30.729 TRACE nova.api.openstack obj = obj[elem]
2013-09-10 13:43:30.729 TRACE nova.api.openstack TypeError: string indices must be integers, not str
description: | updated |
Changed in nova: | |
assignee: | nobody → Andrea Rosa (andrea-rosa-m) |
tags: | added: api |
Changed in nova: | |
milestone: | none → icehouse-2 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-2 → 2014.1 |
Fix proposed to branch: master /review. openstack. org/46086
Review: https:/