500 on deleteing a not existing ec2 security group

Bug #1410172 reported by Attila Fazekas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Liyingjun

Bug Description

Looks like there are 2 reason for seeing 500 errors on not existing ec2 security group delete attempt:

* Unexpected TypeError raised: expected string or buffer
* Unexpected UnboundLocalError raised: local variable 'group' referenced before assignment

Since it is server error the euca2ools automatically and silently retries the request multiple (unlimited?) times.

1. source the ec2 credentials:
$source /opt/stack/new/devstack/accrc/demo/demo

2.a:
$ euca-delete-group --debug 42
...
2015-01-13 09:57:02,907 euca2ools [DEBUG]:Received 500 response. Retrying in 1.9 seconds

2.b:
$ euca-delete-group --debug fortytwo

Relevant lines from the n-api log (It does not contains a full trace, however on this kind of errors it should):

action: DeleteSecurityGroup __call__ /opt/stack/new/nova/nova/api/ec2/__init__.py:379
arg: GroupName val: fortytwo __call__ /opt/stack/new/nova/nova/api/ec2/__init__.py:382
Neutron security group fortytwo not found get /opt/stack/new/nova/nova/network/security_group/neutron_driver.py:138
Unexpected UnboundLocalError raised: local variable 'group' referenced before assignment
EC2 error response: UnboundLocalError: Unknown error occurred. ec2_error_response /opt/stack/new/nova/nova/api/ec2/faults.py:29

Note: The issue seen in a neutron setup.

Tags: ec2 network
tags: added: ec2
Joe Gordon (jogo)
tags: added: network
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Liyingjun (liyingjun)
Changed in nova:
assignee: nobody → Liyingjun (liyingjun)
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/148459

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

Reviewed: https://review.openstack.org/148459
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9ff47340292c374ea7ab623e3405b0ae71de0919
Submitter: Jenkins
Branch: master

commit 9ff47340292c374ea7ab623e3405b0ae71de0919
Author: liyingjun <email address hidden>
Date: Tue Jan 20 15:45:56 2015 +0800

    Fix 500 when deleting a not existing ec2 security group

    There are 2 reason for seeing 500 errors on not existing ec2 security
    group delete attempt:

    * Unexpected TypeError raised: expected string or buffer
    * Unexpected UnboundLocalError raised: local variable 'group' referenced
      before assignment

    Fix the problems by catching the TypeError and raising NotFound
    exception explicitly.

    Change-Id: Iab9a4f99b965dbdd3419ea7585e8a4988eb738ae
    Closes-bug: #1410172

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