yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #15886
[Bug 1264220] Re: An internal error happens if passing invalid parameter to "create flavor_extraspecs" API
** Changed in: nova
Status: Fix Committed => Fix Released
** Changed in: nova
Milestone: None => juno-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/1264220
Title:
An internal error happens if passing invalid parameter to "create
flavor_extraspecs" API
Status in OpenStack Compute (Nova):
Fix Released
Bug description:
If passing invalid parameter to "create flavor_extraspecs" API, an internal error happens and Traceback is written in log file.
Nova should return BadRequest response instead of internal error.
$ curl -i 'http://10.21.42.109:8774/v2/fd283c7ef47b4f46899403e9ebb1e2ed/flavors/6e05eb08-ef1a-4183-9eb9-5c175060247a/os-extra_specs' [..] -d '{"foo": {"key01": "value01"}}'
HTTP/1.1 500 Internal Server Error
Content-Length: 128
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-e8b5120c-e585-4095-a387-d3eed52b7415
Date: Thu, 26 Dec 2013 11:06:46 GMT
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}
$
** The log of nova-api **
2013-12-26 20:06:46.026 ERROR nova.api.openstack [req-e8b5120c-e585-4095-a387-d3eed52b7415 admin demo] Caught error: 'NoneType' object has no attribute 'keys'
2013-12-26 20:06:46.026 TRACE nova.api.openstack Traceback (most recent call last):
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/__init__.py", line 121, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack return req.get_response(self.application)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
2013-12-26 20:06:46.026 TRACE nova.api.openstack application, catch_exc_info=False)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
2013-12-26 20:06:46.026 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack return resp(environ, start_response)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 581, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack return self.app(env, start_response)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack return resp(environ, start_response)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack return resp(environ, start_response)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack response = self.app(environ, start_response)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack return resp(environ, start_response)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2013-12-26 20:06:46.026 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 930, in __call__
2013-12-26 20:06:46.026 TRACE nova.api.openstack content_type, body, accept)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 992, in _process_stack
2013-12-26 20:06:46.026 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 1073, in dispatch
2013-12-26 20:06:46.026 TRACE nova.api.openstack return method(req=request, **action_args)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/compute/contrib/flavorextraspecs.py", line 76, in create
2013-12-26 20:06:46.026 TRACE nova.api.openstack specs)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/nova/nova/db/api.py", line 1487, in flavor_extra_specs_update_or_create
2013-12-26 20:06:46.026 TRACE nova.api.openstack extra_specs)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 130, in wrapper
2013-12-26 20:06:46.026 TRACE nova.api.openstack return f(*args, **kwargs)
2013-12-26 20:06:46.026 TRACE nova.api.openstack File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 4483, in flavor_extra_specs_update_or_create
2013-12-26 20:06:46.026 TRACE nova.api.openstack filter(models.InstanceTypeExtraSpecs.key.in_(specs.keys())).\
2013-12-26 20:06:46.026 TRACE nova.api.openstack AttributeError: 'NoneType' object has no attribute 'keys'
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1264220/+subscriptions
References