Neutron-LBaaS v2: 500 error on creating 2 listeners simultaneously

Bug #1570596 reported by Franklin Naval
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Michael Johnson

Bug Description

1. Create LB
2. Create 2 Listener's simultaneously

Result: 500 thrown
Expected: 409 conflict with an informative error message

Log: http://paste.openstack.org/show/494129/

2016-04-14 20:50:00,177 10041 INFO [tempest.lib.common.rest_client] Request (ListenersTestAdmin:test_create_two_listener_simultaneous): 201 POST http://127.0.0.1:9696/v2.0/lbaas/listeners 0.312s
    2016-04-14 20:50:00,177 10041 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
            Body: {"listener": {"tenant_id": "deffb4d7c0584e89a8ec99551565713c", "loadbalancer_id": "7e0cbab9-e7d3-4ddf-86a5-86362b9fc271", "protocol": "HTTP", "protocol_port": 9080}}
        Response - Headers: {'content-type': 'application/json', 'x-openstack-request-id': 'req-b9ec3d6d-6159-4102-bb28-874e7b3943bb', 'date': 'Thu, 14 Apr 2016 20:50:00 GMT', 'content-length': '384', 'status': '201', 'connection': 'close'}
            Body: {"listener": {"protocol_port": 9080, "protocol": "HTTP", "description": "", "default_tls_container_ref": null, "admin_state_up": true, "loadbalancers": [{"id": "7e0cbab9-e7d3-4ddf-86a5-86362b9fc271"}], "tenant_id": "deffb4d7c0584e89a8ec99551565713c", "sni_container_refs": [], "connection_limit": -1, "default_pool_id": null, "id": "6b9dfdc4-2299-45a7-a832-e6ce7531bc69", "name": ""}}
    2016-04-14 20:50:00,211 10041 INFO [tempest.lib.common.rest_client] Request (ListenersTestAdmin:test_create_two_listener_simultaneous): 500 POST http://127.0.0.1:9696/v2.0/lbaas/listeners 0.033s
    2016-04-14 20:50:00,212 10041 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
            Body: {"listener": {"tenant_id": "deffb4d7c0584e89a8ec99551565713c", "loadbalancer_id": "7e0cbab9-e7d3-4ddf-86a5-86362b9fc271", "protocol": "HTTP", "protocol_port": 9081}}
        Response - Headers: {'content-type': 'application/json', 'x-openstack-request-id': 'req-5d101dbb-42d4-4a26-86e0-df1dc97067a3', 'date': 'Thu, 14 Apr 2016 20:50:00 GMT', 'content-length': '161', 'status': '500', 'connection': 'close'}
            Body: {"NeutronError": {"message": "Invalid state PENDING_UPDATE of loadbalancer resource 7e0cbab9-e7d3-4ddf-86a5-86362b9fc271", "type": "StateInvalid", "detail": ""}}
    2016-04-14 20:50:00,213 10041 INFO [neutron_lbaas.tests.tempest.v2.api.test_listeners_admin:ListenersTestAdmin] Finished: test_create_two_listener_simultaneous

Revision history for this message
Michael Johnson (johnsom) wrote :
Revision history for this message
Franklin Naval (franknaval) wrote :

This bug may be related as the error message of PENDING_UPDATE is seen: https://bugs.launchpad.net/neutron/+bug/1399749

Revision history for this message
Brandon Logan (brandon-logan) wrote :

Error message looks correct, just wrong status code. Looking at the two modules here:

https://github.com/openstack/neutron-lbaas/blob/master/neutron_lbaas/db/loadbalancer/loadbalancer_dbv2.py#L155
https://github.com/openstack/neutron-lbaas/blob/master/neutron_lbaas/extensions/loadbalancerv2.py#L83

This should inherit from nexceptions.Conflict, not the base NeutronException. Conflict should give the appropriate status code.

Changed in neutron:
status: New → Triaged
importance: Undecided → High
Changed in neutron:
assignee: nobody → Michael Johnson (johnsom)
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/306591

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

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

commit 63f4bac2247e45ec66ba8fde04692abacbe1f72c
Author: Michael Johnson <email address hidden>
Date: Fri Apr 15 18:49:44 2016 +0000

    Set HTTP status code to 409 for LBs in PENDING*

    When users attempt to change a LBaaS resource while the load
    balancer is in a PENDING-* state they currently get an error
    with a 500 HTTP status code. This patch changes the status code
    to be 409 (conflict) which is consistent with other "I'm busy"
    errors.

    Change-Id: I6fc0c966e72dde956bd481b71a5cea5ba6d10c55
    Closes-Bug: #1570596

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron-lbaas 9.0.0.0b1

This issue was fixed in the openstack/neutron-lbaas 9.0.0.0b1 development milestone.

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

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/363419

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron-lbaas (stable/mitaka)

Change abandoned by KRISHNA MOULI. TANKALA (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/363419

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

Reviewed: https://review.openstack.org/363419
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=3cf4a7cffd5f76b9f8a3eed649d04075714dcd9c
Submitter: Jenkins
Branch: stable/mitaka

commit 3cf4a7cffd5f76b9f8a3eed649d04075714dcd9c
Author: Michael Johnson <email address hidden>
Date: Fri Apr 15 18:49:44 2016 +0000

    Set HTTP status code to 409 for LBs in PENDING*

    When users attempt to change a LBaaS resource while the load
    balancer is in a PENDING-* state they currently get an error
    with a 500 HTTP status code. This patch changes the status code
    to be 409 (conflict) which is consistent with other "I'm busy"
    errors.

    Change-Id: I6fc0c966e72dde956bd481b71a5cea5ba6d10c55
    Closes-Bug: #1570596
    (cherry picked from commit 63f4bac2247e45ec66ba8fde04692abacbe1f72c)

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lbaas 8.3.0

This issue was fixed in the openstack/neutron-lbaas 8.3.0 release.

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.