TypeError: IPAddress('172.19.0.2') is not JSON serializable

Bug #1649733 reported by YAMAMOTO Takashi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-midonet
Fix Released
Critical
YAMAMOTO Takashi
networking-odl
Fix Released
Critical
Unassigned
neutron
Fix Released
Undecided
YAMAMOTO Takashi

Bug Description

"TypeError: IPAddress('172.19.0.2') is not JSON serializable" seen on gate

eg. http://logs.openstack.org/51/410451/1/check/gate-tempest-dsvm-networking-midonet-ml2-ubuntu-xenial/b810ef8/logs/screen-q-svc.txt.gz#_2016-12-13_23_29_12_286

2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource [req-b4c0541f-8e87-4539-a8ad-c4a2b10098cf admin -] update failed: No details.
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource Traceback (most recent call last):
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/resource.py", line 79, in resource
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource result = method(request=request, **args)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/base.py", line 612, in update
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return self._update(request, id, body, **kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 92, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.force_reraise()
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 88, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource ectxt.value = e.inner_exc
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.force_reraise()
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 128, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource traceback.format_exc())
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.force_reraise()
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 123, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/base.py", line 660, in _update
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource obj = obj_updater(request.context, id, **kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_log/helpers.py", line 48, in wrapper
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return method(*args, **kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 163, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return method(*args, **kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 92, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.force_reraise()
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 88, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource ectxt.value = e.inner_exc
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.force_reraise()
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 128, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource traceback.format_exc())
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.force_reraise()
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 123, in wrapped
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/networking-midonet/midonet/neutron/services/l3/l3_midonet.py", line 159, in update_router
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource "status %s"), id)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.force_reraise()
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/networking-midonet/midonet/neutron/services/l3/l3_midonet.py", line 144, in update_router
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.client.update_router_postcommit(id, r)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/opt/stack/new/networking-midonet/midonet/neutron/client/api.py", line 64, in update_router_postcommit
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource self.api_cli.update_router(router_id, router)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/midonetclient/neutron/l3.py", line 82, in update_router
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource router)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/midonetclient/httpclient.py", line 47, in put
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource headers=headers)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/midonetclient/auth_lib.py", line 108, in do_request
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource disable_ssl_certificate_validation=self.disable_ssl_certificate_validation) # noqa
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/midonetclient/api_lib.py", line 68, in do_request
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource data = json.dumps(body) if body is not None else '{}'
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/json/__init__.py", line 244, in dumps
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return _default_encoder.encode(obj)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource chunks = self.iterencode(o, _one_shot=True)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource return _iterencode(o, 0)
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/json/encoder.py", line 184, in default
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource raise TypeError(repr(o) + " is not JSON serializable")
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource TypeError: IPAddress('172.19.0.2') is not JSON serializable
2016-12-13 23:29:12.286 23652 ERROR neutron.api.v2.resource
2016-12-13 23:29:12.296 23652 INFO neutron.wsgi [req-b4c0541f-8e87-4539-a8ad-c4a2b10098cf admin -] 158.69.82.25 - - [13/Dec/2016 23:29:12] "PUT /v2.0/routers/c2a51c03-ba88-443c-9846-4d0dbbcfd6b3.json HTTP/1.1" 500 368 0.872233

Tags: gate-failure
tags: added: gate-failure
Changed in networking-midonet:
assignee: nobody → YAMAMOTO Takashi (yamamoto)
importance: Undecided → Critical
milestone: none → 4.0.0
status: New → Fix Committed
Changed in networking-midonet:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/410468

Changed in neutron:
assignee: nobody → YAMAMOTO Takashi (yamamoto)
status: New → In Progress
Changed in networking-odl:
importance: Undecided → Critical
assignee: nobody → Isaku Yamahata (yamahata)
assignee: Isaku Yamahata (yamahata) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/410468
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=7b6e236c7c02f81f268bfc9c9089d523187d543e
Submitter: Jenkins
Branch: master

commit 7b6e236c7c02f81f268bfc9c9089d523187d543e
Author: YAMAMOTO Takashi <email address hidden>
Date: Wed Dec 14 09:03:08 2016 +0900

    Restore extraroute dict after OVO change

    A recently merged OVO change [1] made the dict have netaddr objects.
    This change restores plain strings so that it can be JSON
    serializable again.

    [1] I2439116abf051d0e19821ba53895fa0c724f6a96

    Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
    Closes-Bug: #1649733
    Change-Id: Ie64aa161f1a2bb17098d88db20195b7e84bb0eae

Changed in neutron:
status: In Progress → Fix Released
Changed in networking-odl:
status: New → Fix Committed
Changed in networking-midonet:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.0.0b2

This issue was fixed in the openstack/neutron 10.0.0.0b2 development milestone.

Changed in networking-odl:
status: Fix Committed → Fix Released
tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
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.