neutron port-delete operation throws HTTP 500, if port is lb-vip

Bug #1430394 reported by krasnobaeva valentine
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Anand Shanmugam
Kilo
Fix Released
Undecided
Unassigned

Bug Description

1. create a VIP for existed load-balancer

# neutron lb-vip-create --name vip --protocol-port 80 --protocol HTTP --subnet-id <xxx> LB

2. obtain the id of this new VIP by neutron port-list

# neutron port-list
+--------------------------------------+------------------------------------------+-------------------+-------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------------------------------------------+-------------------+-------------------------------------------------------------------------------------+
| 6bbfbc5b-93d2-4791-bb8a-ef292f04aed1 | vip-0093a88f-3c4c-4e84-a9d4-14e9264faa5a | fa:16:3e:7d:b9:b0 | {"subnet_id": "b22172b7-05ee-42b8-b3b9-48a312fdfc97", "ip_address": "192.168.10.5"} |

3. # neutron port-delete 6bbfbc5b-93d2-4791-bb8a-ef292f04aed1
Request Failed: internal server error while processing your request.

# neutron --verbose port-delete 6bbfbc5b-93d2-4791-bb8a-ef292f04aed1
DEBUG: neutronclient.neutron.v2_0.port.DeletePort run(Namespace(id=u'6bbfbc5b-93d2-4791-bb8a-ef292f04aed1', request_format='json'))
DEBUG: neutronclient.client
...
DEBUG: neutronclient.client
REQ: curl -i http://10.162.80.155:9696/v2.0/ports/6bbfbc5b-93d2-4791-bb8a-ef292f04aed1.json -X DELETE -H "X-Auth-Token: MIINoQYJKoZIhvcNAQcCoII......
.....Yr80gJf7djQE1JI+PA-Q==" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-neutronclient"

DEBUG: neutronclient.client RESP:{'date': 'Tue, 10 Mar 2015 15:09:30 GMT', 'status': '500', 'content-length': '88', 'content-type': 'application/json; charset=UTF-8', 'x-openstack-request-id': 'req-75f8c9ca-e273-4e3f-bc4d-9db7d7828794'} {"NeutronError": "Request Failed: internal server error while processing your request."}

DEBUG: neutronclient.v2_0.client Error message: {"NeutronError": "Request Failed: internal server error while processing your request."}
ERROR: neutronclient.shell Request Failed: internal server error while processing your request.
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/neutronclient/shell.py", line 526, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/usr/lib/python2.6/site-packages/neutronclient/shell.py", line 79, in run_command
    return cmd.run(known_args)
  File "/usr/lib/python2.6/site-packages/neutronclient/neutron/v2_0/__init__.py", line 509, in run
    obj_deleter(_id)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 111, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 326, in delete_port
    return self.delete(self.port_path % (port))
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1232, in delete
    headers=headers, params=params)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1221, in retry_request
    headers=headers, params=params)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1164, in do_request
    self._handle_fault_response(status_code, replybody)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 1134, in _handle_fault_response
    exception_handler_v20(status_code, des_error_body)
  File "/usr/lib/python2.6/site-packages/neutronclient/v2_0/client.py", line 84, in exception_handler_v20
    message=error_dict)
NeutronClientException: Request Failed: internal server error while processing your request.
DEBUG: neutronclient.shell clean_up DeletePort
DEBUG: neutronclient.shell Got an error: Request Failed: internal server error while processing your request.
[root@kvalenti-controller ~(keystone_admin)]# neutron port-delete 6bbfbc5b-93d2-4791-bb8a-ef292f04aed1
Request Failed: internal server error while processing your request.
#

It's better to return "Unable to delete" or some other temporary error code. This mocking is not so painful for returning "500" to clients .

summary: - neutron port-delete operation throws HTTP 500, if removing port is lb-
- vip
+ neutron port-delete operation throws HTTP 500, if port is lb-vip
description: updated
tags: added: api
tags: removed: lb-vip loadbalancer
tags: removed: neutron
Changed in neutron:
assignee: nobody → Anand Shanmugam (anand1712)
Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
Changed in neutron:
assignee: Anand Shanmugam (anand1712) → nobody
assignee: nobody → senthilmageswaran (senthilmageswaran-muthusamy)
Revision history for this message
senthilmageswaran (senthilmageswaran-muthusamy) wrote :

On checking code, i found on deleting ports with VIP configured, dberror(database integrity) is thrown.
in my opinion, we need to catch that exception and proper error message need to be returned to neutron client.
This will help users to know exact error.

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lbaas (master)

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

Changed in neutron:
assignee: senthilmageswaran (senthilmageswaran-muthusamy) → Anand Shanmugam (anand1712)
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/180421

Changed in neutron:
assignee: Anand Shanmugam (anand1712) → senthilmageswaran (senthilmageswaran-muthusamy)
Changed in neutron:
assignee: senthilmageswaran (senthilmageswaran-muthusamy) → Anand Shanmugam (anand1712)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

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

commit 84fb6660a337e5e1f515b600ac8c22c6fdf82ec9
Author: Anand Shanmugam <email address hidden>
Date: Thu May 21 02:03:33 2015 -0700

    Adding loadbalanacerv2 device owner constant to neutron constants

    The neutron constants doesn't have the constant for device owner
    lbaasv2. This fix adds the constant. This is needed for the bug 1430394
    as we need to check the device owner when the port is to be deleted.
    Partial-Bug: #1430394

    Change-Id: I222a9f44c5ed6c879feb2fb9e04047ae8f2c7745

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (neutron-pecan)

Fix proposed to branch: neutron-pecan
Review: https://review.openstack.org/185072

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Kyle Mestery (<email address hidden>) on branch: master
Review: https://review.openstack.org/180421
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lbaas (master)

Reviewed: https://review.openstack.org/176016
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=dba6eea593f532b7d7f7b3c1bcd4dee950d6fe18
Submitter: Jenkins
Branch: master

commit dba6eea593f532b7d7f7b3c1bcd4dee950d6fe18
Author: Anand Shanmugam <email address hidden>
Date: Tue Apr 21 22:51:56 2015 +0530

    Adding code to prevent vip port deletion from port api

    When a lbaas port is deleted from the port delete command from
    neutron it tries to delete the port but since it is being held
    for the vip the database update fails and neutron throws a 500
    error

    This fix checks if the vip is associated to the port and allows
    deletion of the port only if there is no vip associated with the
    port

    Change-Id: If9f123dedfe86225c52b6d26c76a64e3f5bee15c
    Closes-Bug: #1430394

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lbaas (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/217439

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

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/217843

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

Reviewed: https://review.openstack.org/217843
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=533900c241794c1d2646f263b982801a8ac26a3a
Submitter: Jenkins
Branch: stable/kilo

commit 533900c241794c1d2646f263b982801a8ac26a3a
Author: Anand Shanmugam <email address hidden>
Date: Thu May 21 02:03:33 2015 -0700

    Adding loadbalanacerv2 device owner constant to neutron constants

    The neutron constants doesn't have the constant for device owner
    lbaasv2. This fix adds the constant. This is needed for the bug 1430394
    as we need to check the device owner when the port is to be deleted.
    Partial-Bug: #1430394

    Change-Id: I222a9f44c5ed6c879feb2fb9e04047ae8f2c7745
    (cherry picked from commit 84fb6660a337e5e1f515b600ac8c22c6fdf82ec9)

tags: added: in-stable-kilo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lbaas (stable/kilo)

Reviewed: https://review.openstack.org/217439
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=8156548109816e73a6e12aab1d7f2358d2c43b99
Submitter: Jenkins
Branch: stable/kilo

commit 8156548109816e73a6e12aab1d7f2358d2c43b99
Author: Anand Shanmugam <email address hidden>
Date: Tue Apr 21 22:51:56 2015 +0530

    Adding code to prevent vip port deletion from port api

    When a lbaas port is deleted from the port delete command from
    neutron it tries to delete the port but since it is being held
    for the vip the database update fails and neutron throws a 500
    error

    This fix checks if the vip is associated to the port and allows
    deletion of the port only if there is no vip associated with the
    port

    Change-Id: If9f123dedfe86225c52b6d26c76a64e3f5bee15c
    Closes-Bug: #1430394
    (cherry picked from commit dba6eea593f532b7d7f7b3c1bcd4dee950d6fe18)

Thierry Carrez (ttx)
Changed in neutron:
milestone: liberty-1 → 7.0.0
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.