← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1756360] Re: Serializer strips Exception kwargs

 

Reviewed:  https://review.openstack.org/555812
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=cc457dfffad7c4980e6f36364bdf190c79cf23e1
Submitter: Zuul
Branch:    master

commit cc457dfffad7c4980e6f36364bdf190c79cf23e1
Author: Tyler Blakeslee <tblakes@xxxxxxxxxx>
Date:   Fri Mar 23 08:21:27 2018 -0600

    Add __repr__ for NovaException
    
    Due to change c1a7079c26d27a2e46cca26963d3d9aa040bdbe8 in
    oslo.serialization, serialized exceptions in errors no longer
    have kwargs. This change fixes the problem by adding __repr__
    to NovaException which will return a string representation
    of exception.__dict__. This string contains the exception message
    along with all the kwargs. Without __repr__, the serialization
    process for exceptions just returns the exception type and the
    default message, without the kwargs.
    
    Change-Id: I653282a030d03362dfca0fd1026cebe920d54e37
    Closes-Bug: #1756360


** 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/1756360

Title:
  Serializer strips Exception kwargs

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========
  A change in oslo serialization makes it so when Exceptions are serialized the value returned is repr(Exception). This is resulting in the Exception kwargs being stripped from the serialized Exception.
  https://github.com/openstack/oslo.serialization/commit/c1a7079c26d27a2e46cca26963d3d9aa040bdbe8

  Steps to reproduce
  ==================
  Here is the code flow where the bug was noticed. The bug is not specific to this code flow, but rather any exception notification that is serialized will have this problem.

  nova.compute.api.API._create_instance()
  nova.conductor.manager.ComputeTaskManager.schedule_and_build_instances()
  nova.conductor.manager.ComputeTaskManager._bury_in_cell0()
  nova.conductor.manager.ComputeTaskManager._set_vm_state_and_notify()
  nova.scheduler.utils.set_vm_state_and_notify()
  oslo_messaging.notify.notifier.Notifier.error()
  oslo_messaging.notify.notifier.Notifier._notify()
  oslo_messaging.serializer.JsonPayloadSerializer.serialize_entity()
  oslo_serialization.jsonutils.to_primitive()

  Expected result
  ===============
  When an Exception is serialized, we would expect it to contain all of the pertinent information that it had before being serialized.

  Actual result
  =============
  When an Exception is serialized, the kwargs are being stripped from it by the repr() method call.

  Environment
  ===========
  Queens environments containing the commit https://github.com/openstack/oslo.serialization/commit/c1a7079c26d27a2e46cca26963d3d9aa040bdbe8 will have this problem.

  Logs & Configs
  ==============
  N/A

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


References