AttributeError: 'NoneType' object has no attribute 'obj' (driver.obj.release_segment(session, segment))

Bug #1292102 reported by Nobuto Murata
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Kevin Benton
Icehouse
Fix Released
Undecided
James Page
neutron (Ubuntu)
Fix Released
Medium
Unassigned
Trusty
Triaged
Medium
Unassigned
Utopic
Fix Released
Medium
Unassigned

Bug Description

When trying to delete a network, I hit a traceback.

ubuntu@neutron01:~$ neutron port-list

ubuntu@neutron01:~$ neutron net-list
+--------------------------------------+---------+---------+
| id | name | subnets |
+--------------------------------------+---------+---------+
| 822d2b2e-481f-4838-9fe5-459be7b10193 | int_net | |
| ac498310-833b-42f2-9009-049cac145c71 | ext_net | |
+--------------------------------------+---------+---------+

ubuntu@neutron01:~$ neutron --debug net-delete int_net
Request Failed: internal server error while processing your request.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/neutronclient/shell.py", line 527, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/usr/lib/python2.7/dist-packages/neutronclient/shell.py", line 80, in run_command
    return cmd.run(known_args)
  File "/usr/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 510, in run
    obj_deleter(_id)
  File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 112, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 354, in delete_network
    return self.delete(self.network_path % (network))
  File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 1233, in delete
    headers=headers, params=params)
  File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 1222, in retry_request
    headers=headers, params=params)
  File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 1165, in do_request
    self._handle_fault_response(status_code, replybody)
  File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 1135, in _handle_fault_response
    exception_handler_v20(status_code, des_error_body)
  File "/usr/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 85, in exception_handler_v20
    message=error_dict)
NeutronClientException: Request Failed: internal server error while processing your request.
ubuntu@neutron01:~$

/var/log/neutron/server.log
====
2014-03-13 12:30:09.930 16624 ERROR neutron.api.v2.resource [req-cc63906f-1e13-4d22-becf-86979d80399f None] delete failed
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource Traceback (most recent call last):
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 87, in resource
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource result = method(request=request, **args)
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 438, in delete
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource obj_deleter(request.context, id, **kwargs)
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/plugin.py", line 479, in delete_network
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource self.type_manager.release_segment(session, segment)
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/managers.py", line 104, in release_segment
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource driver.obj.release_segment(session, segment)
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource AttributeError: 'NoneType' object has no attribute 'obj'
2014-03-13 12:30:09.930 16624 TRACE neutron.api.v2.resource

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: neutron-plugin-ml2 1:2014.1~b3-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-16.36-generic 3.13.5
Uname: Linux 3.13.0-16-generic x86_64
ApportVersion: 2.13.3-0ubuntu1
Architecture: amd64
Date: Thu Mar 13 12:36:03 2014
PackageArchitecture: all
ProcEnviron:
 TERM=screen.linux
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: neutron
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.neutron.plugins.ml2.ml2.conf.arista.ini: [deleted]
modified.conffile..etc.neutron.plugins.ml2.ml2.conf.brocade.ini: [deleted]
modified.conffile..etc.neutron.plugins.ml2.ml2.conf.cisco.ini: [deleted]
modified.conffile..etc.neutron.plugins.ml2.ml2.conf.ini: [deleted]
modified.conffile..etc.neutron.plugins.ml2.ml2.conf.mlnx.ini: [deleted]
modified.conffile..etc.neutron.plugins.ml2.ml2.conf.ncs.ini: [deleted]
modified.conffile..etc.neutron.plugins.ml2.ml2.conf.ofa.ini: [deleted]

Revision history for this message
Nobuto Murata (nobuto) wrote :
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/85592

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit af89d74d2961db6a04572375150ad908c9e72e78
Author: Kevin Benton <email address hidden>
Date: Sun Apr 6 04:57:36 2014 -0700

    Verify ML2 type driver exists before calling del

    Verifies that an ML2 type driver exists for a given
    segment type before attempting to call the release_segment
    method on it. Logs an error if a type driver is not
    found.

    This covers the case where a segment is created with
    a given type and then ML2 is reconfigured without
    support for that type.

    DocImpact
    The ML2 documentation should be updated with a warning
    that disabling a network type driver and re-enabling
    it later may lead to possible DB inconsistencies.

    Closes-Bug: #1292102
    Change-Id: I65a35abf3ed57347bb6e8fee228f8c0697217c00

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in neutron (Ubuntu):
status: New → Confirmed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → juno-1
status: Fix Committed → Fix Released
James Page (james-page)
Changed in neutron (Ubuntu):
status: Confirmed → Fix Released
Changed in neutron (Ubuntu Trusty):
status: New → Triaged
Changed in neutron (Ubuntu Utopic):
importance: Undecided → Medium
Changed in neutron (Ubuntu Trusty):
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/111263

Revision history for this message
James Page (james-page) wrote :

Cherry picked and proposed for stable/icehouse but I don't appear to have permissions to even nominate a bug task for icehouse.

Revision history for this message
Alan Pevec (apevec) wrote :

Don't worry about Icehouse task, stable release managers will add it once fix is merged.
Proposing a patch for stable/icehouse is much appreciated and is one of the methods to get the backport process started:
 https://wiki.openstack.org/wiki/StableBranch#Proposing_Fixes

Unfortunatelly your backport came after 2014.1.2 freeze so if you think this is a critical issue and must be included in 2014.1.2 please propose it for freeze exception on the openstack-stable-maint list.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/icehouse)

Reviewed: https://review.openstack.org/111263
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ad82fadf546d39f3c905b5fb633f64afb7875a6f
Submitter: Jenkins
Branch: stable/icehouse

commit ad82fadf546d39f3c905b5fb633f64afb7875a6f
Author: Kevin Benton <email address hidden>
Date: Sun Apr 6 04:57:36 2014 -0700

    Verify ML2 type driver exists before calling del

    Verifies that an ML2 type driver exists for a given
    segment type before attempting to call the release_segment
    method on it. Logs an error if a type driver is not
    found.

    This covers the case where a segment is created with
    a given type and then ML2 is reconfigured without
    support for that type.

    DocImpact
    The ML2 documentation should be updated with a warning
    that disabling a network type driver and re-enabling
    it later may lead to possible DB inconsistencies.

    Closes-Bug: #1292102
    Change-Id: I65a35abf3ed57347bb6e8fee228f8c0697217c00
    (cherry picked from commit af89d74d2961db6a04572375150ad908c9e72e78)

tags: added: in-stable-icehouse
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-1 → 2014.2
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.