nova boot via invalid neutron port raises 500

Bug #1245700 reported by Aaron Rosen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Aaron Rosen
python-neutronclient
Fix Released
High
Aaron Rosen

Bug Description

2013-10-28 15:46:38.470 ERROR nova.api.openstack [req-e405f8e2-95a1-4748-8f9f-c642080e16b3 demo demo] Caught error: local variable 'port' referenced before assignment
2013-10-28 15:46:38.470 TRACE nova.api.openstack Traceback (most recent call last):
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/__init__.py", line 119, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack return req.get_response(self.application)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
2013-10-28 15:46:38.470 TRACE nova.api.openstack application, catch_exc_info=False)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
2013-10-28 15:46:38.470 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack return resp(environ, start_response)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 571, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack return self.app(env, start_response)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack return resp(environ, start_response)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack return resp(environ, start_response)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack response = self.app(environ, start_response)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack return resp(environ, start_response)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2013-10-28 15:46:38.470 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 939, in __call__
2013-10-28 15:46:38.470 TRACE nova.api.openstack content_type, body, accept)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 998, in _process_stack
2013-10-28 15:46:38.470 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 1079, in dispatch
2013-10-28 15:46:38.470 TRACE nova.api.openstack return method(req=request, **action_args)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/compute/servers.py", line 924, in create
2013-10-28 15:46:38.470 TRACE nova.api.openstack legacy_bdm=legacy_bdm)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/hooks.py", line 105, in inner
2013-10-28 15:46:38.470 TRACE nova.api.openstack rv = f(*args, **kwargs)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/compute/api.py", line 1218, in create
2013-10-28 15:46:38.470 TRACE nova.api.openstack legacy_bdm=legacy_bdm)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/compute/api.py", line 859, in _create_instance
2013-10-28 15:46:38.470 TRACE nova.api.openstack block_device_mapping, auto_disk_config, reservation_id)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/compute/api.py", line 673, in _validate_and_build_base_options
2013-10-28 15:46:38.470 TRACE nova.api.openstack self._check_requested_networks(context, requested_networks)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/compute/api.py", line 437, in _check_requested_networks
2013-10-28 15:46:38.470 TRACE nova.api.openstack self.network_api.validate_networks(context, requested_networks)
2013-10-28 15:46:38.470 TRACE nova.api.openstack File "/opt/stack/nova/nova/network/neutronv2/api.py", line 553, in validate_networks
2013-10-28 15:46:38.470 TRACE nova.api.openstack if not port:
2013-10-28 15:46:38.470 TRACE nova.api.openstack UnboundLocalError: local variable 'port' referenced before assignment

Tags: network
Aaron Rosen (arosen)
Changed in nova:
assignee: nobody → Aaron Rosen (arosen)
tags: added: network
Aaron Rosen (arosen)
affects: nova → python-neutronclient
Changed in python-neutronclient:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/54211

Changed in python-neutronclient:
status: New → In Progress
Revision history for this message
Aaron Rosen (arosen) wrote :

Actually the nova code can be made slightly more robust here.

Aaron Rosen (arosen)
Changed in nova:
assignee: nobody → Aaron Rosen (arosen)
importance: Undecided → Low
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/54219
Committed: http://github.com/openstack/nova/commit/2392f746d31028dca5fdf6de423f807bfaf69c84
Submitter: Jenkins
Branch: master

commit 2392f746d31028dca5fdf6de423f807bfaf69c84
Author: Aaron Rosen <email address hidden>
Date: Mon Oct 28 18:05:15 2013 -0700

    Correct exception handling

    Previously, it was possible for an exception to be hidden and cause other
    errors for example:
        UnboundLocalError: local variable 'port' referenced before assignment
    was previously occuring if e.status_code != 404

    Fixes bug: 1245700

    Change-Id: I27e44ffd33a73c88745de8fda8fd7c374435808a

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (master)

Reviewed: https://review.openstack.org/54211
Committed: http://github.com/openstack/python-neutronclient/commit/feda92ff0b28514b27e8e05713368962366c9fa4
Submitter: Jenkins
Branch: master

commit feda92ff0b28514b27e8e05713368962366c9fa4
Author: Aaron Rosen <email address hidden>
Date: Mon Oct 28 16:33:27 2013 -0700

    Fix status_code not passed in code

    The python-neutronclient was refactored to raise NeutronClientException
    and when that occured the status_code field was dropped. This causes errors
    on the nova-side to occur as nova checks the status_code to do error handling.

    Fixes bug: 1245700

    Change-Id: Ie1fcf3fef0e20c33ce18549bca6a2413a9f98e9f

Changed in python-neutronclient:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
milestone: none → 2.3.0-2.3.4
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
status: Fix Committed → Fix Released
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.