← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1790444] Re: Nova crashes when added new RPC interface

 

I'm going to mark this as invalid. If you want some help debugging your
code, you can post it to gerrit and get some help there to identify what
is wrong in your change, but it looks like you're trying to send the
SchedulerReportClient over RPC and that object is not serializable.

** Changed in: nova
       Status: New => Invalid

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

Title:
  Nova crashes when added new RPC interface

Status in OpenStack Compute (nova):
  Invalid

Bug description:
  For some reason I need to add a RPC interface to nova-compute. When I
  tested the new interface, I got this error:

  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server [req-ff6e2750-98a2-4c13-95d0-548d9f66101d 3ff71b27e1e9446c8972c423e1b0d81e 123a456966664881a8380faa009e752f - default default] Exception during message handling: AttributeError: 'SchedulerReportClient' object has no attribute 'obj_to_primitive'
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     res = self.dispatcher.dispatch(message)
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 268, in dispatch
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     return self._do_dispatch(endpoint, method, ctxt, args)
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 195, in _do_dispatch
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     return self.serializer.serialize_entity(ctxt, result)
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/openstack/lib/python2.7/site-packages/nova/rpc.py", line 130, in serialize_entity
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     return self._base.serialize_entity(context, entity)
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/openstack/lib/python2.7/site-packages/nova/objects/base.py", line 237, in serialize_entity
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     entity)
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/openstack/lib/python2.7/site-packages/nova/objects/base.py", line 223, in _process_iterable
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     for k, v in values.items()})
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/openstack/lib/python2.7/site-packages/nova/objects/base.py", line 223, in <dictcomp>
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     for k, v in values.items()})
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/openstack/lib/python2.7/site-packages/nova/objects/base.py", line 240, in serialize_entity
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     entity = entity.obj_to_primitive()
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server   File "/openstack/lib/python2.7/site-packages/nova/scheduler/client/__init__.py", line 39, in __run_method
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server     return getattr(self.instance, __name)(*args, **kwargs)
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server AttributeError: 'SchedulerReportClient' object has no attribute 'obj_to_primitive'
  2018-09-03 02:23:56.870 70765 ERROR oslo_messaging.rpc.server

  The function`serialize_entity` in nova/nova/objects/base.py is:

      def serialize_entity(self, context, entity):
          if isinstance(entity, (tuple, list, set, dict)):
              entity = self._process_iterable(context, self.serialize_entity,
                                              entity)
          elif (hasattr(entity, 'obj_to_primitive') and
                callable(entity.obj_to_primitive)):
              entity = entity.obj_to_primitive()
          return entity

  hasattr(entity, 'obj_to_primitive') and
  callable(entity.obj_to_primitive) always return true because entity is
  a LazyLoader class and it implemented `__getattr__`.

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


References