← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1579706] Re: listing nova instances with invalid status raises 500 InternalServerError for admin user

 

Reviewed:  https://review.openstack.org/335648
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ee4d69e28dfb3d4764186d0c0212d53c99bda3ca
Submitter: Jenkins
Branch:    master

commit ee4d69e28dfb3d4764186d0c0212d53c99bda3ca
Author: EdLeafe <ed@xxxxxxxxx>
Date:   Wed Jun 29 18:51:34 2016 +0000

    Return HTTP 200 on list for invalid status
    
    The server listing API raises a 500 error if you pass an invalid status
    filter for admin user. In the case of a non-admin user, it simply
    returns an empty list. In the case of an admin user, it fetches extended
    server attributes, so a condition was added to get extended server
    attributes only when servers list is not empty.
    
    This change simply removes the cause of the 500 exception. A subsequent
    patch with a microversion bump will modify the behavior so that a 400
    Bad Request will be raised for an invalid status, for both admin and
    non-admin alike.
    
    Co-Authored-By: Dinesh Bhor <dinesh.bhor@xxxxxxxxxxx>
    
    Closes-Bug: #1579706
    
    Change-Id: I10bde78f0a9ac59b8646d58f62fa5056f989f54f


** Changed in: nova
       Status: In Progress => Fix Released

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

Title:
  listing nova instances with invalid status raises 500
  InternalServerError for admin user

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Listing nova instances with invalid status raises 500
  InternalServerError for admin user.

  Steps to reproduce
  ==================
  Command:
  nova list --status invalid-status

  Actual result
  =============
  ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) 
  (Request-ID: req-07567061-bd94-4c83-ba8e-510cad9f388b)

  Expected result
  ===============
  It should return empty instance list.

  n-API LOG:
  2016-05-09 10:42:28.653 ERROR nova.api.openstack [req-07567061-bd94-4c83-ba8e-510cad9f388b admin admin] Caught error: 'instances'
  2016-05-09 10:42:28.653 TRACE nova.api.openstack Traceback (most recent call last):
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/__init__.py", line 134, in __call__
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return req.get_response(self.application)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1299, in s
  end
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     application, catch_exc_info=False)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1263, in c
  all_application
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     app_iter = application(self.environ, start_response)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call
  __
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return resp(environ, start_response)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call
  __
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     resp = self.call_func(req, *args, **self.kwargs)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_f
  unc
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return self.func(req, *args, **kwargs)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__in
  it__.py", line 467, in __call__
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     response = req.get_response(self._app)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1299, in send
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     application, catch_exc_info=False)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1263, in call_application
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     app_iter = application(self.environ, start_response)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return resp(environ, start_response)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return resp(environ, start_response)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 141, in __call__
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     response = self.app(environ, start_response)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return resp(environ, start_response)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     resp = self.call_func(req, *args, **self.kwargs)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return self.func(req, *args, **kwargs)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 674, in __call__
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     content_type, body, accept)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 758, in _process_stack
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     request, action_args)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 621, in post_process_extensions
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     **action_args)
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/compute/extended_server_attributes.py", line 92, in detail
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     instances = req.get_db_instances()
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 145, in get_db_instances
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return self.get_db_items('instances')
  2016-05-09 10:42:28.653 TRACE nova.api.openstack   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 128, in get_db_items
  2016-05-09 10:42:28.653 TRACE nova.api.openstack     return self._extension_data['db_items'][key]
  2016-05-09 10:42:28.653 TRACE nova.api.openstack KeyError: 'instances'
  2016-05-09 10:42:28.653 TRACE nova.api.openstack

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


References