Internal server error when deleting empty network with OVS plugin

Bug #1261652 reported by Eugene Nikanorov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Eugene Nikanorov

Bug Description

Deleting a network which has no ports and no subnets on it produces the following stack trace in neutron-server logs when using PostgreSql:

2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource Traceback (most recent call last):
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 84, in resource
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource result = method(request=request, **args)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 438, in delete
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource obj_deleter(request.context, id, **kwargs)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/openvswitch/ovs_neutron_plugin.py", line 526, in delete_network
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource super(OVSNeutronPluginV2, self).delete_network(context, id)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 999, in delete_network
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource for p in ports)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2227, in __iter__
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource return self._execute_and_instances(context)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2242, in _execute_and_instances
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource result = conn.execute(querycontext.statement, self._params)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1449, in execute
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource params)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1584, in _execute_clauseelement
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource compiled_sql, distilled_params
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource context)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource context)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 331, in do_execute
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource cursor.execute(statement, parameters)
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource NotSupportedError: (NotSupportedError) SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join

2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource 'SELECT ports.tenant_id AS ports_tenant_id, ports.id AS ports_id, ports.name AS ports_name, ports.network_id AS ports_network_id, ports.mac_address AS ports_mac_address, ports.admin_state_up AS ports_admin_state_up, ports.status AS ports_status, ports.device_id AS ports_device_id, ports.device_owner AS ports_device_owner, ipallocations_1.port_id AS ipallocations_1_port_id, ipallocations_1.ip_address AS ipallocations_1_ip_address, ipallocations_1.subnet_id AS ipallocations_1_subnet_id, ipallocations_1.network_id AS ipallocations_1_network_id, allowedaddresspairs_1.port_id AS allowedaddresspairs_1_port_id, allowedaddresspairs_1.mac_address AS allowedaddresspairs_1_mac_address, allowedaddresspairs_1.ip_address AS allowedaddresspairs_1_ip_address, extradhcpopts_1.id AS extradhcpopts_1_id, extradhcpopts_1.port_id AS extradhcpopts_1_port_id, extradhcpopts_1.opt_name AS extradhcpopts_1_opt_name, extradhcpopts_1.opt_value AS extradhcpopts_1_opt_value, portbindingports_1.port_id AS portbindingports_1_port_id, portbindingports_1.host AS portbindingports_1_host, securitygroupportbindings_1.port_id AS securitygroupportbindings_1_port_id, securitygroupportbindings_1.security_group_id AS securitygroupportbindings_1_security_group_id \nFROM ports LEFT OUTER JOIN portbindingports ON ports.id = portbindingports.port_id LEFT OUTER JOIN ipallocations AS ipallocations_1 ON ports.id = ipallocations_1.port_id LEFT OUTER JOIN allowedaddresspairs AS allowedaddresspairs_1 ON ports.id = allowedaddresspairs_1.port_id LEFT OUTER JOIN extradhcpopts AS extradhcpopts_1 ON ports.id = extradhcpopts_1.port_id LEFT OUTER JOIN portbindingports AS portbindingports_1 ON ports.id = portbindingports_1.port_id LEFT OUTER JOIN securitygroupportbindings AS securitygroupportbindings_1 ON ports.id = securitygroupportbindings_1.port_id \nWHERE ports.tenant_id = %(tenant_id_1)s AND ports.network_id IN (%(network_id_1)s) FOR UPDATE' {'network_id_1': u'f8344378-ed58-4ce3-99ae-408c8591cda9', 'tenant_id_1': u'df3896201a174787b65b2b098aad2968'}
2013-12-17 12:43:49.908 7347 TRACE neutron.api.v2.resource
2013-12-17 12:43:49.920 7347 INFO neutron.wsgi [req-b8b4b523-cf50-4bcb-8356-19bbc4b9d057 8549dfbbb00940b9b3659230186bd26d df3896201a174787b65b2b098aad2968] 192.168.1.51 - - [17/Dec/2013 12:43:49] "DELETE /v2.0/networks/f8344378-ed58-4ce3-99ae-408c8591cda9.json HTTP/1.1" 500 230 0.063668

Tags: db ovs
tags: added: db ovs
description: updated
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/63597

Changed in neutron:
status: New → In Progress
summary: - Internal server error when deleting network with OVS plugin
+ Internal server error when deleting empty network with OVS plugin
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 44b3783ceb94934bf8d4d62f704d42b49e52866e
Author: Eugene Nikanorov <email address hidden>
Date: Sun Dec 22 00:48:48 2013 +0400

    Fix empty network deletion in db_base_plugin for postgresql

    Need to disable joined loads for port query in delete_network
    as in other methods.

    No unit test is being added, because the problem is not reproducible with
    sqlite.

    Closes-Bug: #1261652

    Change-Id: I7a015be6f2f9b8ae43bc29a767d16af30120f13f

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-2 → 2014.1
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.