Serializer strips Exception kwargs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Tyler Blakeslee |
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:/
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.
nova.conductor.
nova.conductor.
nova.conductor.
nova.scheduler.
oslo_messaging.
oslo_messaging.
oslo_messaging.
oslo_serializat
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:/
Logs & Configs
==============
N/A
tags: | added: notifications |
Changed in nova: | |
assignee: | nobody → Tyler Blakeslee (tblakes) |
status: | New → In Progress |
Changed in nova: | |
status: | Confirmed → In Progress |
Changed in nova: | |
importance: | Undecided → Low |
"This is resulting in the Exception kwargs being stripped from the serialized Exception."
I tried to reproduce that before the referenced oslo.serialization change the kwargs of the Exception is serialized. But I failed:
(py27) ebalgib@ elxa95hld12: ~/upstream/ git/oslo. serialization$ pip freeze | grep seriali ion==2. 21.1 elxa95hld12: ~/upstream/ git/oslo. serialization$ python Exception) : _init__ ('message' ) to_primitive( MyException( named_arg= 'alma') ) ion/jsonutils. py:188: UserWarning: Cannot convert MyException( 'message' ,) to primitive, will raise ValueError instead of warning in version 3.0
oslo.serializat
(py27) ebalgib@
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyException(
... def __init__(self, named_arg):
... super(MyException, self)._
...
>>> from oslo_serialization import jsonutils
>>> print jsonutils.
oslo_serializat
"instead of warning in version 3.0" % (value,))
message
Could you attach some logs that shows that Exception kwargs being serialized with old enough oslo serialization?