← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1649733] Re: TypeError: IPAddress('172.19.0.2') is not JSON serializable

 

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 <yamamoto@xxxxxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1649733

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

Status in networking-midonet:
  In Progress
Status in networking-odl:
  New
Status in neutron:
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/networking-midonet/+bug/1649733/+subscriptions