← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1198796] Re: update cell error

 

** Changed in: nova
       Status: Fix Committed => 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/1198796

Title:
  update cell error

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  I updated the cell info and the response is as follows:
  {
      "computeFault": {
          "message": "The server has either erred or is incapable of performing the requested operation.",
          "code": 500
      }
  }

  I found error in nova-cells.log:
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack Traceback (most recent call last):
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/__init__.py", line 81, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return req.get_response(self.application)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     application, catch_exc_info=False)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     app_iter = application(self.environ, start_response)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py", line 450, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return self.app(env, start_response)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     response = self.app(environ, start_response)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return resp(environ, start_response)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     resp = self.call_func(req, *args, **self.kwargs)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return self.func(req, *args, **kwargs)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 890, in __call__
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     content_type, body, accept)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 942, in _process_stack
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     action_result = self.dispatch(meth, request, action_args)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 1022, in dispatch
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return method(req=request, **action_args)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/cells.py", line 257, in update
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return dict(cell=_scrub_cell(cell))
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/cells.py", line 118, in _scrub_cell
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     cell_info = _filter_keys(cell, keys)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack   File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/cells.py", line 110, in _filter_keys
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack     return dict((k, v) for k, v in item.iteritems() if k in keys)
  2013-07-07 23:55:20.777 31477 TRACE nova.api.openstack AttributeError: 'Query' object has no attribute 'iteritems'

  
  I viewed the code and found that:
  @require_admin_context
  def cell_update(context, cell_name, values):
      session = get_session()
      with session.begin():
          cell = _cell_get_by_name_query(context, cell_name, session=session)
          cell.update(values)
      return cell

  The method nova.db.sqlalchemy.api.cell_update() returns a 'Query'
  object.

  def _filter_keys(item, keys):
      """
      Filters all model attributes except for keys
      item is a dict

      """
      return dict((k, v) for k, v in item.iteritems() if k in keys)

  The method nova.api.openstack.compute.contrib.cells_filter_keys() uses
  the 'Query' object as a dict.

  This bring on the error.

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