Container creation returns 500 for a BadRequest. Expected error code: 400

Bug #1327438 reported by Meera Belur
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Medium
Arun Kant

Bug Description

Container creation returns 500 for a BadRequest. Expected error code: 400

Here's the post data for container create request which violates the DB integrity constraints (secret_ref not unique).

containerpostdata:

{
  "name": "my rsakey",
  "type": "rsa",
  "secret_refs": [
    {
       "name": "public_key",
        "secret_ref": "http://localhost:9311/v1/3d90e76b1a834657859bbb2ab94a3faf/secrets/1fd98b1a-858e-41ee-81f4-b0b36ba143f2"
        },
    {
       "name": "private_key",
        "secret_ref": "http://localhost:9311/v1/3d90e76b1a834657859bbb2ab94a3faf/secrets/78231ddc-d0a1-4b8c-8aa2-10b1a5dba96b"
    },
    {
       "name": "private_key_passphrase",
        "secret_ref": "http://localhost:9311/v1/3d90e76b1a834657859bbb2ab94a3faf/secrets/1fd98b1a-858e-41ee-81f4-b0b36ba143f2"
    }
  ]
}

curl -i http://localhost:9311/v1/3d90e76b1a834657859bbb2ab94a3faf/containers -H "X-Auth-Token:63179d26f81541159d579232dc8c13f9" -XPOST -d @containerpostdata -H "Content-Type: application/json"
HTTP/1.1 500 Internal Server Error
Content-Type: text/html; charset=UTF-8
Content-Length: 134

{"code": 500, "description": "Container creation failure seen - please contact site administrator.", "title": "Internal Server Error"}

Arun Kant (arukant)
Changed in barbican:
assignee: nobody → Arun Kant (arunkant-uws)
description: updated
John Wood (john-wood-w)
Changed in barbican:
milestone: none → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to barbican (master)

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

Changed in barbican:
status: New → In Progress
Changed in barbican:
importance: Undecided → Medium
Changed in barbican:
milestone: juno-2 → juno-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to barbican (master)

Reviewed: https://review.openstack.org/98926
Committed: https://git.openstack.org/cgit/openstack/barbican/commit/?id=d3ad9eb021019c7b6efd21ad8b92bf94c8f55c6d
Submitter: Jenkins
Branch: master

commit d3ad9eb021019c7b6efd21ad8b92bf94c8f55c6d
Author: Arun Kant <email address hidden>
Date: Mon Jun 9 17:23:55 2014 -0700

    Added duplicate secret_id validation in a container request

    Change-Id: I8ff780013bee2617361cc807ef696fa007f1305a
    Closes-Bug: 1327438

Changed in barbican:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in barbican:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in barbican:
milestone: juno-3 → 2014.2
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.