Deleting a network which has no ports and no subnets on it produces the follwoing stack trace in neutron-server logs:
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
Deleting a network which has no ports and no subnets on it produces the follwoing stack trace in neutron-server logs:
2013-12-17 12:43:49.908 7347 TRACE neutron. api.v2. resource Traceback (most recent call last): api.v2. resource File "/opt/stack/ neutron/ neutron/ api/v2/ resource. py", line 84, in resource api.v2. resource result = method( request= request, **args) api.v2. resource File "/opt/stack/ neutron/ neutron/ api/v2/ base.py" , line 438, in delete api.v2. resource obj_deleter( request. context, id, **kwargs) api.v2. resource File "/opt/stack/ neutron/ neutron/ plugins/ openvswitch/ ovs_neutron_ plugin. py", line 526, in delete_network api.v2. resource super(OVSNeutro nPluginV2, self).delete_ network( context, id) api.v2. resource File "/opt/stack/ neutron/ neutron/ db/db_base_ plugin_ v2.py", line 999, in delete_network api.v2. resource for p in ports) api.v2. resource File "/usr/lib/ python2. 7/dist- packages/ sqlalchemy/ orm/query. py", line 2227, in __iter__ api.v2. resource return self._execute_ and_instances( context) api.v2. resource File "/usr/lib/ python2. 7/dist- packages/ sqlalchemy/ orm/query. py", line 2242, in _execute_ and_instances api.v2. resource result = conn.execute( querycontext. statement, self._params) api.v2. resource File "/usr/lib/ python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1449, in execute api.v2. resource params) api.v2. resource File "/usr/lib/ python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1584, in _execute_ clauseelement api.v2. resource compiled_sql, distilled_params api.v2. resource File "/usr/lib/ python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1698, in _execute_context api.v2. resource context) api.v2. resource File "/usr/lib/ python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1691, in _execute_context api.v2. resource context) api.v2. resource File "/usr/lib/ python2. 7/dist- packages/ sqlalchemy/ engine/ default. py", line 331, in do_execute api.v2. resource cursor. execute( statement, parameters) 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.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.908 7347 TRACE neutron.
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, allowedaddressp airs_1. port_id AS allowedaddressp airs_1_ port_id, allowedaddressp airs_1. mac_address AS allowedaddressp airs_1_ mac_address, allowedaddressp airs_1. ip_address AS allowedaddressp airs_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, portbindingport s_1.port_ id AS portbindingport s_1_port_ id, portbindingport s_1.host AS portbindingport s_1_host, securitygrouppo rtbindings_ 1.port_ id AS securitygrouppo rtbindings_ 1_port_ id, securitygrouppo rtbindings_ 1.security_ group_id AS securitygrouppo rtbindings_ 1_security_ group_id \nFROM ports LEFT OUTER JOIN portbindingports ON ports.id = portbindingport s.port_ id LEFT OUTER JOIN ipallocations AS ipallocations_1 ON ports.id = ipallocations_ 1.port_ id LEFT OUTER JOIN allowedaddresspairs AS allowedaddressp airs_1 ON ports.id = allowedaddressp airs_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 = portbindingport s_1.port_ id LEFT OUTER JOIN securitygrouppo rtbindings AS securitygrouppo rtbindings_ 1 ON ports.id = securitygrouppo rtbindings_ 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-408c8591cd a9', 'tenant_id_1': u'df3896201a174 787b65b2b098aad 2968'} api.v2. resource cf50-4bcb- 8356-19bbc4b9d0 57 8549dfbbb00940b 9b3659230186bd2 6d df3896201a17478 7b65b2b098aad29 68] 192.168.1.51 - - [17/Dec/2013 12:43:49] "DELETE /v2.0/networks/ f8344378- ed58-4ce3- 99ae-408c8591cd a9.json HTTP/1.1" 500 230 0.063668
2013-12-17 12:43:49.908 7347 TRACE neutron.
2013-12-17 12:43:49.920 7347 INFO neutron.wsgi [req-b8b4b523-