← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1239723] Re: 500 response on booting a server with disk security group argument

 

** Changed in: nova
       Status: Fix Committed => Fix Released

** Changed in: nova
    Milestone: None => kilo-rc1

-- 
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/1239723

Title:
  500 response on booting a server with disk security group argument

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  curl -i http://127.0.0.1:8774/v2/28e0a231507c4dff846cbc4dd6cd814c/servers -X POST -H "X-Auth-Project-Id: demo" -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: <TOKEN>" -d '{"server": {"name": "server", "imageRef": "bb3048da-0cca-474f-9f05-e04bf176520c", "flavorRef": "42", "max_count": 1, "min_count": 1, "security_groups": {"name": "sec"}}}'
  HTTP/1.1 500 Internal Server Error
  Content-Length: 128
  Content-Type: application/json; charset=UTF-8
  X-Compute-Request-Id: req-87686a62-a4c0-4c46-b873-ff24f87d94e4
  Date: Mon, 14 Oct 2013 14:41:44 GMT

  {"computeFault": {"message": "The server has either erred or is
  incapable of performing the requested operation.", "code": 500}}

  I have modified the curl command from the 'nova --debug boot server
  --flavor 42 --image cirros-0.3.1-x86_64-uec --security-group sec'

  and changed the 
   "security_groups": [{"name": "sec"}]
   part to 
  "security_groups": {"name": "sec"}

  When the nova-api gets a dict instead of list of dict causes a 500
  response.

  2013-10-14 14:41:43.437 ERROR nova.api.openstack [req-87686a62-a4c0-4c46-b873-ff24f87d94e4 demo demo] Caught error: 'unicode' object has no attribute 'get'
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack Traceback (most recent call last):
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/opt/stack/new/nova/nova/api/openstack/__init__.py", line 119, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     return req.get_response(self.application)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/request.py", line 1296, in send
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     application, catch_exc_info=False)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/request.py", line 1260, in call_application
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     app_iter = application(self.environ, start_response)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/opt/stack/new/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 571, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     return self.app(env, start_response)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/routes/middleware.py", line 131, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     response = self.app(environ, start_response)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/dec.py", line 130, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     resp = self.call_func(req, *args, **self.kwargs)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/dec.py", line 195, in call_func
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     return self.func(req, *args, **kwargs)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/opt/stack/new/nova/nova/api/openstack/wsgi.py", line 917, in __call__
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     content_type, body, accept)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/opt/stack/new/nova/nova/api/openstack/wsgi.py", line 976, in _process_stack
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     action_result = self.dispatch(meth, request, action_args)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/opt/stack/new/nova/nova/api/openstack/wsgi.py", line 1057, in dispatch
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     return method(req=request, **action_args)
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack   File "/opt/stack/new/nova/nova/api/openstack/compute/servers.py", line 779, in create
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack     if sg.get('name')]
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack AttributeError: 'unicode' object has no attribute 'get'
  2013-10-14 14:41:43.437 22092 TRACE nova.api.openstack

  The  '"security_groups": "foo"' also causes 500 response.

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