← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1380792] Re: requests to EC2 metadata's '/2009-04-04/meta-data/security-groups' failing

 

** Also affects: nova/juno
   Importance: Undecided
       Status: New

** Changed in: nova/juno
       Status: New => Fix Committed

** Changed in: nova/juno
    Milestone: None => 2014.2.1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1380792

Title:
  requests to EC2 metadata's '/2009-04-04/meta-data/security-groups'
  failing

Status in OpenStack Compute (Nova):
  Fix Committed
Status in OpenStack Compute (nova) juno series:
  Fix Committed
Status in nova package in Ubuntu:
  Confirmed

Bug description:
  Just did a distro upgrade to juno rc2.. Running an old nova-network
  cloud with mult-host, nova-api running on compute host.  Noticed
  ubuntu instances cloud-init is failing:

  Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/boto/utils.py", line 177, in retry_url
      resp = urllib2.urlopen(req)
    File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
      return _opener.open(url, data, timeout)
    File "/usr/lib/python2.7/urllib2.py", line 406, in open
      response = meth(req, response)
    File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
      'http', request, response, code, msg, hdrs)
    File "/usr/lib/python2.7/urllib2.py", line 444, in error
      return self._call_chain(*args)
    File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
      result = func(*args)
    File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
      raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

  Looking at nova-api.log on compute, webob is throwing an exception:

  2014-10-13 13:47:37.468 9183 INFO nova.metadata.wsgi.server [req-e133f95b-5f99-41e5-89dc-8e35b41f7cd6 None] 10.0.0.6 "GET /2009-04-04/meta-data/security-groups HTTP/1.1" status: 400 len: 265 time: 0.2675409
  2014-10-13 13:48:41.947 9182 ERROR nova.api.ec2 [req-47b84883-a48c-4004-914b-c983895a33be None] FaultWrapper: You cannot set Response.body to a text object (use Response.text)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2 Traceback (most recent call last):
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/nova/api/ec2/__init__.py", line 87, in __call__
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     return req.get_response(self.application)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     application, catch_exc_info=False)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     app_iter = application(self.environ, start_response)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     resp = self.call_func(req, *args, **self.kwargs)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     return self.func(req, *args, **kwargs)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/nova/api/ec2/__init__.py", line 99, in __call__
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     rv = req.get_response(self.application)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     application, catch_exc_info=False)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     app_iter = application(self.environ, start_response)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     resp = self.call_func(req, *args, **self.kwargs)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     return self.func(req, *args, **kwargs)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/nova/api/metadata/handler.py", line 136, in __call__
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     req.response.body = resp
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2   File "/usr/lib/python2.7/dist-packages/webob/response.py", line 373, in _body__set
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2     raise TypeError(msg)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2 TypeError: You cannot set Response.body to a text object (use Response.text)
  2014-10-13 13:48:41.947 9182 TRACE nova.api.ec2 

  A bit of poking shows that nova.api.metadata.base.ec2_md_print() is
  converting the secgroup list to string:

      elif isinstance(data, list):
          return '\n'.join(data)

  .. but in this case data=[u'default'], and the exception is being
  raised when resp.body = u'default'.  ec2_md_print() needs to ensure
  its returning non-unicode string here.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1380792/+subscriptions


References