duplicate rbac policy internal server error

Bug #1551473 reported by Kevin Benton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Kevin Benton

Bug Description

creating a duplcate RBAC policy results in an internal server error:

administrator@15:21:42:/opt/stack/neutron$ neutron rbac-create 1da63901-c3b1-4bb0-9e83-d03a8016b627 --action access_as_shared --type network --target-tenant 44
Created a new rbac_policy:
+---------------+--------------------------------------+
| Field | Value |
+---------------+--------------------------------------+
| action | access_as_shared |
| id | 1a2e3faa-9e95-4e0c-8044-5d9845aef954 |
| object_id | 1da63901-c3b1-4bb0-9e83-d03a8016b627 |
| object_type | network |
| target_tenant | 44 |
| tenant_id | ac167722a61943d792bf7dc50c01dca6 |
+---------------+--------------------------------------+
administrator@15:21:53:/opt/stack/neutron$ neutron rbac-create 1da63901-c3b1-4bb0-9e83-d03a8016b627 --action access_as_shared --type network --target-tenant 44
Request Failed: internal server error while processing your request.

LOGS:

2016-02-29 15:21:55.573 27994 ERROR neutron.api.v2.resource DBDuplicateEntry: (pymysql.err.IntegrityError) (1062, u"Duplicate entry 'access_as_shared-1da63901-c3b1-4bb0-9e83-d03a8016b627-44' for key 'uniq_networkrbacs0tenant_target0object_id0action'") [SQL: u'INSERT INTO networkrbacs (tenant_id, id, target_tenant, action, object_id) VALUES (%(tenant_id)s, %(id)s, %(target_tenant)s, %(action)s, %(object_id)s)'] [parameters: {'action': u'access_as_shared', 'tenant_id': u'ac167722a61943d792bf7dc50c01dca6', 'target_tenant': u'44', 'id': 'd0176c95-981a-4a35-bc3b-407bcf2d0de8', 'object_id': u'1da63901-c3b1-4bb0-9e83-d03a8016b627'}]

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
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/286329

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → High
milestone: none → mitaka-3
tags: added: liberty-backport-potential
tags: added: access-control
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/286329
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9712e364fc4ea81c5958d63524a528e8aff44770
Submitter: Jenkins
Branch: master

commit 9712e364fc4ea81c5958d63524a528e8aff44770
Author: Kevin Benton <email address hidden>
Date: Mon Feb 29 15:35:45 2016 -0800

    Catch DBDuplicateEntry errors in RBAC code

    This catches duplicate entry errors in the RBAC code
    and converts them into an an appropriate exception so
    clients get an HTTP conflict instead of an internal
    server error.

    Change-Id: I957ade2356ae9cb5bbb7e2322b4dcb37706665cf
    Closes-Bug: #1551473

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 8.0.0.0b3

This issue was fixed in the openstack/neutron 8.0.0.0b3 development milestone.

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/297058

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

Reviewed: https://review.openstack.org/297058
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4848c717c3641e1664772b8162c90b83b1ded5e3
Submitter: Jenkins
Branch: stable/liberty

commit 4848c717c3641e1664772b8162c90b83b1ded5e3
Author: Kevin Benton <email address hidden>
Date: Mon Feb 29 15:35:45 2016 -0800

    Catch DBDuplicateEntry errors in RBAC code

    This catches duplicate entry errors in the RBAC code
    and converts them into an an appropriate exception so
    clients get an HTTP conflict instead of an internal
    server error.

    Conflicts:
     neutron/db/rbac_db_mixin.py

    Change-Id: I957ade2356ae9cb5bbb7e2322b4dcb37706665cf
    Closes-Bug: #1551473
    (cherry picked from commit 9712e364fc4ea81c5958d63524a528e8aff44770)

tags: added: in-stable-liberty
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 7.1.0

This issue was fixed in the openstack/neutron 7.1.0 release.

tags: removed: liberty-backport-potential
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.