l3 dvr code passing ip allocation objects to update_port

Bug #1622824 reported by Kevin Benton
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Kevin Benton

Bug Description

The l3 dvr code is passing IP allocation objects to update_port, which is not supported by the retry decorator protecting update_port. This results in the following exception:

2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource [req-347d1015-bdce-4e58-8179-68ff758b62f4 tempest-TestGettingAddress-1311327307 -] add_router_interface failed: No details.
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource Traceback (most recent call last):
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/resource.py", line 79, in resource
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource result = method(request=request, **args)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 87, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 83, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource ectxt.value = e.inner_exc
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 123, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource traceback.format_exc())
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 118, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/api/v2/base.py", line 221, in _handle_action
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource ret_value = getattr(self._plugin, name)(*arg_list, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 155, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return method(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 87, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 83, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource ectxt.value = e.inner_exc
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 123, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource traceback.format_exc())
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 118, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/l3_dvr_db.py", line 415, in add_router_interface
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource port['id'])
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/l3_dvr_db.py", line 385, in add_router_interface
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource {'port': {'fixed_ips': fixed_ips}})
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/common/utils.py", line 618, in inner
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(self, context, *args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 155, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return method(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 87, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 83, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource ectxt.value = e.inner_exc
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 123, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource traceback.format_exc())
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.force_reraise()
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 118, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/plugins/ml2/plugin.py", line 1383, in update_port
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource port)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/api.py", line 155, in wrapped
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return method(*args, **kwargs)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/db_base_plugin_v2.py", line 1221, in update_port
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource new_port=new_port)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/ipam_backend_mixin.py", line 724, in update_port
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource new_port.get('mac_address'))
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/ipam_pluggable_backend.py", line 329, in update_port_with_ips
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource new_mac)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/ipam_pluggable_backend.py", line 282, in _update_ips_for_port
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource context, original_ips, new_ips, port['device_owner'])
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/opt/stack/new/neutron/neutron/db/ipam_backend_mixin.py", line 424, in _get_changed_ips_for_port
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource if ip.get('subnet_id') not in delete_subnet_ids]
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/models.py", line 68, in get
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return getattr(self, key, default)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 237, in __get__
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource return self.impl.get(instance_state(instance), dict_)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 578, in get
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource value = state._load_expired(state, passive)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/state.py", line 474, in _load_expired
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource self.manager.deferred_scalar_loader(self, toload)
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/loading.py", line 610, in load_scalar_attributes
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource (state_str(state)))
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource DetachedInstanceError: Instance <IPAllocation at 0x7f8f2191ccd0> is not bound to a Session; attribute refresh operation cannot proceed
2016-09-13 00:26:29.206 13801 ERROR neutron.api.v2.resource

http://logs.openstack.org/33/367333/5/gate/gate-tempest-dsvm-neutron-dvr-ubuntu-xenial/b8f08fe/logs/screen-q-svc.txt.gz?level=TRACE#_2016-09-13_00_26_29_206

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
milestone: none → newton-rc1
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/369134

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → High
Revision history for this message
John Schwarz (jschwarz) wrote :

Bug https://bugs.launchpad.net/neutron/+bug/1622905 is a duplicate of this, and as such I added the tags that it had (gate-failure, l3-ipam-dhcp).

tags: added: gate-failure l3-ipam-dhcp
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit d223bef22449db3752d57a9eb6b4915074004e32
Author: Kevin Benton <email address hidden>
Date: Mon Sep 12 18:59:30 2016 -0700

    Don't work with native DB port objects in DVR code

    Passing around native DB records into core plugin operations
    as part of the call arguments can result in detached session
    errors. It's also just bad practice since the core plugin API
    is expected to take regular dictionaries containing strings.

    Closes-Bug: #1622824
    Change-Id: I0d33c6ac9a9ceeebbd5c1179eb41aec6c991a2bf

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.0.0.0rc1

This issue was fixed in the openstack/neutron 9.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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