GET on key pairs gives 500

Bug #925731 reported by Jaydeep
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Vish Ishaya

Bug Description

500 error GET on key pairs
This must be 400 Bad Request.

Request: https://servers.api.openstack.com/v1.1/{tenantId}/os-keypairs/{keyname}
method: GET

Response:

"computeFault":{

     "message":"The server has either erred or is incapable of performing\r\nthe requested operation.\r\n",
     "code":500

}

Revision history for this message
Brian Waldon (bcwaldon) wrote :

Are you requesting the literal string "https://servers.api.openstack.com/v1.1/{tenantId}/os-keypairs/{keyname}"?

Changed in nova:
status: New → Incomplete
Revision history for this message
Jaydeep (jaydeep-c1) wrote :

Sorry, somehow the url got messed up.
The curl request I am making is :

curl -i -H "X-Auth-Token: ee200d70-a38c-442e-bd79-73d20f863e0f" http://localhost:8774/v1.1/15/os-keypairs/keypair-33642498981

Where keypair-33642498981 is the Key name.

The response is still the same:

{"computeFault": {"message": "The server has either erred or is incapable of performing\r\nthe requested operation.\r\n", "code": 500}}

Revision history for this message
Brian Waldon (bcwaldon) wrote :

Can you verify that the keypair exists in the database? And can you please verify this off of today's master branch? There have been several recent bug fixes related to keypairs.

Revision history for this message
Jaydeep (jaydeep-c1) wrote :

Just checked in the DB and the key-pair i am trying to fetch exists. Below is the request/response i am trying,

Request:

curl -i -H "X-Auth-Token: ee200d70-a38c-442e-bd79-73d20f863e0f" http://localhost:8774/v1.1/15/os-keypairs/key1

Where "key1" is the Key name.

Response:

{"computeFault": {"message": "The server has either erred or is incapable of performing\r\nthe requested operation.\r\n", "code": 500}}

Let me know if you need any other info.

Revision history for this message
Sateesh Bodla (sateesh-bodla) wrote :

I am trying to reproduce the bug. I got 404 Not Found exception even when the key present. Please find below the traceball of my commands:

root@vmessex198:~# nova keypair-add key1
-----BEGIN RSA PRIVATE KEY-----
<Private Key Here>
-----END RSA PRIVATE KEY-----

root@vmessex198:~# nova keypair-list
+------+-------------------------------------------------+
| Name | Fingerprint |
+------+-------------------------------------------------+
| key1 | <fingerprint here> |
+------+-------------------------------------------------+
root@vmessex198:~# curl -i -H "X-Auth-Token: <my auth token>" http://10.233.53.198:8774/v1.1/cloudproject/os-keypairs/key1
HTTP/1.1 404 Not Found
Via: 1.1 HYSPROXY1
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 78
Date: Fri, 06 Apr 2012 12:04:18 GMT
Content-Type: application/json; charset=UTF-8

{"itemNotFound": {"message": "The resource could not be found.", "code": 404}}

Please let me know if I am going in correct way.

Regards,
Sateesh B.

Thierry Carrez (ttx)
Changed in nova:
status: Incomplete → New
Revision history for this message
Dan Prince (dan-prince) wrote :

The existing keypairs extension in the OS API doesn't actually currently support GET/SHOW on an individual keypair.

This is easy enough to support though so we should probably add it.

Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → Low
status: New → In Progress
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/11415

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/11415
Committed: http://github.com/openstack/nova/commit/a8024cd667b9d1a3aa5ce2fcfb6725b25ace9b6c
Submitter: Jenkins
Branch: master

commit a8024cd667b9d1a3aa5ce2fcfb6725b25ace9b6c
Author: Dan Prince <email address hidden>
Date: Wed Aug 15 12:01:12 2012 -0400

    Add get_key_pair to compute API.

    This will be used to implement a GET keypair API call.

    Partial fix for LP Bug #925731.

    Change-Id: Ie9976c0168842c7491d80be6213814192a2024df

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Changed in nova:
status: Fix Released → In Progress
Changed in nova:
assignee: Dan Prince (dan-prince) → Vish Ishaya (vishvananda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/11416
Committed: http://github.com/openstack/nova/commit/06d1f0dfd5d22ace96b414fd0b71fbaa668b95ce
Submitter: Jenkins
Branch: master

commit 06d1f0dfd5d22ace96b414fd0b71fbaa668b95ce
Author: Dan Prince <email address hidden>
Date: Wed Aug 15 12:34:30 2012 -0400

    Implement GET (show) in OS API keypairs extension.

    Includes test for showing a keypair (existing and non-existing).

    This commit also corrects the name of the KeyPairNotFound exception
    in the test_keypair_delete_not_found test case.

    Additionally some extra print statements in the tests were
    removed.

    DocImpact - need to add documentation for GET on: v2/{tenant_id}/os-keypairs/{keypair_name}

    Fixes LP Bug #925731.

    Change-Id: I9eeb47ccb9bf352c554aa44aa562c47e3eb33cae

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/11535

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (milestone-proposed)

Reviewed: https://review.openstack.org/11535
Committed: http://github.com/openstack/nova/commit/91c05cb10e8a1c139247ca45c4b2801af72e3ed9
Submitter: Jenkins
Branch: milestone-proposed

commit 91c05cb10e8a1c139247ca45c4b2801af72e3ed9
Author: Dan Prince <email address hidden>
Date: Wed Aug 15 12:34:30 2012 -0400

    Implement GET (show) in OS API keypairs extension.

    Includes test for showing a keypair (existing and non-existing).

    This commit also corrects the name of the KeyPairNotFound exception
    in the test_keypair_delete_not_found test case.

    Additionally some extra print statements in the tests were
    removed.

    DocImpact - need to add documentation for GET on: v2/{tenant_id}/os-keypairs/{keypair_name}

    Fixes LP Bug #925731.

    Change-Id: I9eeb47ccb9bf352c554aa44aa562c47e3eb33cae
    (cherry picked from commit 06d1f0dfd5d22ace96b414fd0b71fbaa668b95ce)

Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.