Keystone returns traceback for db backend

Bug #1039552 reported by Dmitry
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
High
Unassigned

Bug Description

When I try to create project with same name as an already existing project:

curl -i -X 'POST' 'http://172.18.40.105:35357/v2.0/tenants' -H 'User-Agent: python-openstackclient-base' -H 'Content-Type: application/json' -H 'X-Auth-Token: 9d3f2a8cc70f485ab4ee669a3bd8f2cb' -d '{"tenant": {"enabled": true, "name": "test-project", "description": null}}'

I see:

Conflict: Conflict occurred attempting to store tenant. (IntegrityError) (1062, "Duplicate entry 'test-project' for key 'name'") 'INSERT INTO tenant (id, name, extra) VALUES (%s, %s, %s)' ('ae5bc5c8a91841ddb9eb58b4cc4bb5ee', 'test-project', '{"enabled": true, "description": null}') (HTTP 409)

Maybe it is not a good thing to show client such an ugly and difficult to read message and it can looks better as:

Conflict: Conflict occurred attempting to store tenant. (IntegrityError) (1062, "Duplicate entry 'test-project' for key 'name'")

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

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

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

Reviewed: https://review.openstack.org/11712
Committed: http://github.com/openstack/keystone/commit/dcb1e84fe0be383cb6f8f97820b67b29cc5ef95f
Submitter: Jenkins
Branch: master

commit dcb1e84fe0be383cb6f8f97820b67b29cc5ef95f
Author: Dmitry Khovyakov <email address hidden>
Date: Tue Aug 21 10:38:32 2012 -0400

    Less information returned with IntegrityError

    Fixes bug: #1039552

    Change-Id: Ie91ff09cadbbf24dc88b013581ebdd4a37c3b6b0

Changed in keystone:
status: In Progress → Fix Committed
Joseph Heck (heckj)
Changed in keystone:
milestone: none → folsom-rc1
importance: Undecided → High
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: folsom-rc1 → 2012.2
Revision history for this message
Yair Fried (yfried) wrote :

Hi, I'm seeing the same ugly error message in Icehouse.
Shouldn't this be fixed?

[root@localhost devstack]# keystone tenant-create --name alt_demo
Conflict occurred attempting to store project. (IntegrityError) (1062, "Duplicate entry 'default-alt_demo' for key 'domain_id'") 'INSERT INTO project (id, name, domain_id, description, enabled, extra) VALUES (%s, %s, %s, %s, %s, %s)' ('28b728c1f93c4530aab672a8468c1595', 'alt_demo', 'default', None, 1, '{}') (HTTP 409)
https://bugs.launchpad.net/keystone/+bug/1039552

devstack built from master with hash:
bb606a441a016d7f0b709012bba1597448cebfc7

Revision history for this message
Dolph Mathews (dolph) wrote :

Yair: will you open a new bug with the above and link back to this one as a regression?

Revision history for this message
Adam Young (ayoung) wrote :
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.