"unexpected error" attempting to rename a project when name is already in use

Bug #1565108 reported by Matthew Edmonds
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Liyingjun

Bug Description

When a user attempts to rename a project via the PATCH v3/projects/{project_id} API, and the new name is already in-use, rather than return a nice error explaining that the name is in use, keystone blows up and returns an HTTP 500:

# curl -k -1 -i -X PATCH https://localhost:5000/v3/projects/e4e12eb216ca471cb2646bcdbdcc3ddc -H "User-Agent: python-keystoneclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 04a2539bb3144af6867d8c7e50b15607" -d '{"project": {"name": "Project_B"}}'
HTTP/1.1 500 Internal Server Error
Date: Fri, 01 Apr 2016 21:42:50 GMT
Server: Apache
Vary: X-Auth-Token
x-openstack-request-id: req-8d9904e7-5775-42ec-8fc5-773f7f38cbf2
Content-Length: 143
Connection: close
Content-Type: application/json

{"error": {"message": "An unexpected error prevented the server from fulfilling your request.", "code": 500, "title": "Internal Server Error"}}

Liyingjun (liyingjun)
Changed in keystone:
status: New → Confirmed
assignee: nobody → Liyingjun (liyingjun)
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/301418

Changed in keystone:
status: Confirmed → In Progress
Revision history for this message
Liyingjun (liyingjun) wrote :
tags: added: mitaka-backport-potential
Changed in keystone:
milestone: none → newton-1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/301418
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=c1be6883f250e6bc0ad1b43eb516186f74a477f1
Submitter: Jenkins
Branch: master

commit c1be6883f250e6bc0ad1b43eb516186f74a477f1
Author: liyingjun <email address hidden>
Date: Thu Mar 31 08:13:49 2016 +0800

    Fix KeyError when rename to a name is already in use

    When a user attempts to rename a project via the PATCH
    v3/projects/{project_id} API, and the new name is already in-use, rather
    than return a nice error explaining that the name is in use, keystone
    blows up and raises `KeyError: 'is_domain'` in
    _generate_project_name_conflict_msg.

    Change-Id: I56fcd8fe1258e2d1de3e541144649ef619f86a7b
    Closes-bug: #1565108

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/mitaka)

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

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

Reviewed: https://review.openstack.org/306003
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=3dfc046375851f7852513574d52a405004f6a853
Submitter: Jenkins
Branch: stable/mitaka

commit 3dfc046375851f7852513574d52a405004f6a853
Author: liyingjun <email address hidden>
Date: Thu Mar 31 08:13:49 2016 +0800

    Fix KeyError when rename to a name is already in use

    When a user attempts to rename a project via the PATCH
    v3/projects/{project_id} API, and the new name is already in-use, rather
    than return a nice error explaining that the name is in use, keystone
    blows up and raises `KeyError: 'is_domain'` in
    _generate_project_name_conflict_msg.

    Change-Id: I56fcd8fe1258e2d1de3e541144649ef619f86a7b
    Closes-bug: #1565108
    (cherry picked from commit c1be6883f250e6bc0ad1b43eb516186f74a477f1)

tags: added: in-stable-mitaka
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/keystone 9.0.1

This issue was fixed in the openstack/keystone 9.0.1 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/keystone 10.0.0.0b1

This issue was fixed in the openstack/keystone 10.0.0.0b1 development milestone.

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.