update_port passes device_id=None but neutron expects ''

Bug #1285886 reported by Aaron Rosen
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Aaron Rosen

Bug Description

2014-02-27 14:08:23.013 ERROR nova.network.neutronv2.api [req-598b0d2f-e4e9-40eb-a9d4-027975d08b39 demo demo] Failed to delete neutron port 153f472b-f662-497b-bc7c-3cc362157ab1
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api Traceback (most recent call last):
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api File "/opt/stack/nova/nova/network/neutronv2/api.py", line 420, in deallocate_for_instance
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api neutron.update_port(port, port_req_body)
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 111, in with_params
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api ret = self.function(instance, *args, **kwargs)
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 321, in update_port
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api return self.put(self.port_path % (port), body=body)
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1245, in put
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api headers=headers, params=params)
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1221, in retry_request
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api headers=headers, params=params)
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1164, in do_request
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api self._handle_fault_response(status_code, replybody)
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1134, in _handle_fault_response
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api exception_handler_v20(status_code, des_error_body)
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 84, in exception_handler_v20
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api message=error_dict)
2014-02-27 14:08:23.013 TRACE nova.network.neutronv2.api NeutronClientException: Invalid input for device_id. Reason: 'None' is not a valid string.

2014-02-27 14:08:23.011 ERROR neutron.api.v2.resource [req-3f133c17-198f-412d-b57e-66bbf0fcfbcb neutron abd2b56aa998417ba5af609a680a138d] update failed
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource Traceback (most recent call last):
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 84, in resource
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource result = method(request=request, **args)
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 466, in update
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource allow_bulk=self._allow_bulk)
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 600, in prepare_request_body
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource raise webob.exc.HTTPBadRequest(msg)
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource HTTPBadRequest: Invalid input for device_id. Reason: 'None' is not a valid string.
2014-02-27 14:08:23.011 TRACE neutron.api.v2.resource

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

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

Changed in nova:
status: New → In Progress
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/77046
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=621fc02f70fa4fa50b2f05167eefa39b71f72024
Submitter: Jenkins
Branch: master

commit 621fc02f70fa4fa50b2f05167eefa39b71f72024
Author: Aaron Rosen <email address hidden>
Date: Thu Feb 27 18:44:52 2014 -0800

    Nova should pass device_id='' instead of None to neutron.update_port()

    In the case that neutron raises an error and nova needs to undo the api
    calls it's done against neutron it should pass device_id='' instead of
    None otherwise neutron raises an exception.

    Note: This should have a unit test but it's near impossible
    to add one right without duplicating all of _stub_allocate_for_instance
    due to the fact that it's using some crazy logic in the tests to make
    decisions based on an index that's passed it. X.x

    Change-Id: I91334c07401ff379f71fdef1d5bd080cc68a72ab
    Closes-bug: #1285886

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
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.