fake_notifier: ValueError: Circular reference detected

Bug #1403162 reported by Dan Smith
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Dan Smith

Bug Description

The fake_notifier code is using anyjson, which today is failing to serialize something in a notification payload. Failure looks like this:

    Traceback (most recent call last):
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/mock.py", line 1201, in patched
        return func(*args, **keywargs)
      File "nova/tests/unit/compute/test_compute.py", line 2774, in test_reboot_fail
        self._test_reboot(False, fail_reboot=True)
      File "nova/tests/unit/compute/test_compute.py", line 2744, in _test_reboot
        reboot_type=reboot_type)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 420, in assertRaises
        self.assertThat(our_callable, matcher)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 431, in assertThat
        mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 481, in _matchHelper
        mismatch = matcher.match(matchee)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
        mismatch = self.exception_matcher.match(exc_info)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
        mismatch = matcher.match(matchee)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 412, in match
        reraise(*matchee)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
        result = matchee()
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 965, in __call__
        return self._callable_object(*self._args, **self._kwargs)
      File "nova/exception.py", line 88, in wrapped
        payload)
      File "nova/tests/unit/fake_notifier.py", line 57, in _notify
        anyjson.serialize(payload)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/anyjson/__init__.py", line 141, in dumps
        return implementation.dumps(value)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/anyjson/__init__.py", line 87, in dumps
        return self._encode(data)
      File "/home/dan/nova/.tox/py27/lib/python2.7/site-packages/oslo/serialization/jsonutils.py", line 186, in dumps
        return json.dumps(obj, default=default, **kwargs)
      File "/usr/lib64/python2.7/json/__init__.py", line 250, in dumps
        sort_keys=sort_keys, **kw).encode(obj)
      File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
        chunks = self.iterencode(o, _one_shot=True)
      File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
        return _iterencode(o, 0)
    ValueError: Circular reference detected

Changed in nova:
assignee: nobody → Dan Smith (danms)
status: Confirmed → In Progress
Revision history for this message
Jay Pipes (jaypipes) wrote :

327 occurrences in last 24 hours: http://goo.gl/LBSz8M

Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote :

Proposal can be found here https://review.openstack.org/#/c/142175

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 7ed9268a1f61b708cb1360c2d89aa25e935a8f4a
Author: Dan Smith <email address hidden>
Date: Tue Dec 16 10:19:56 2014 -0800

    Fix using anyjson in fake_notifier

    For some reason we were using anyjson.serialize() in our fake_notifier.
    That may have been to mirror kombu, but really we need to mirror what we
    do when we convert our payloads to primitives, which is using jsonutils.

    Closes-Bug: #1403162
    Change-Id: I92a4708e0700e88f4b2554aa4e7ad3856f5be1e0

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.