creation of KeyPair with blank key name throws 500

Bug #925741 reported by Jaydeep
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Undecided
Unassigned

Bug Description

It should throw 400

Request:
URI:https://servers.api.openstack.com/v1.1/{tenantId}/os-keypairs
Method:POST
API:/v1.1/{tenantId}/os-keypairs

parameter:
{'keypair': {'name': name}}

Responsce.

resp={'date': 'Thu, 01 Dec 2011 02:52:16 GMT', 'status': '500', 'content-length': '133', 'content-type': 'application/json; charset=UTF-8'}
body={"cloudServersFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}

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

Can you show any logs that show this on the nova-api side of things? It's a little confusing to see this report when we've recently fixed this bug: https://bugs.launchpad.net/nova/+bug/900927.

Changed in horizon:
status: New → Incomplete
Revision history for this message
Jake Dahn (jakedahn) wrote :

Also I am unable to reproduce because the form submit is caught by django validation.

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

Hi,

Here is the exact curl request I am trying to make:

curl -i -X POST -H "X-Auth-Token:ee200d70-a38c-442e-bd79-73d20f863e0f" -d '{"keypair": {"name": ""}}' http://localhost:8774/v1.1/15//os-keypairs -H "Content-Type: application/json"

And the response:

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

Just verified that if I include some name to the Key it works fine. For example, I get a 200 when I send:

curl -i -X POST -H "X-Auth-Token:ee200d70-a38c-442e-bd79-73d20f863e0f" -d '{"keypair": {"name": "testKeyName"}}' http://localhost:8774/v1.1/15//os-keypairs -H "Content-Type: application/json"

Response:

{"keypair": {"public_key": "ssh-rsa AAAAB3NzaC1yc2EAgQDMRePt4vn2/2mZNiAOyJYDzg3NMtIG2vSwwHg9Fz/x2UL3aOopixomk2dcms0rk18o1DmzrZHITysqSAKTD6ngei8HwlHtfNQ84Y+5VCS2f1lrPtZ6x22HJFWPkNT7UsLjipQXZgnq6EoKl+wa2EaoYb4BydcxTJ7rfkld84G22Q\n", "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIICXQIBAAKBgQDMRePt4vn2/2mZNiAOyJYDzg3NMtIG2vSwwHg9Fz/x2UL3aOop\nixomk2dcms0rk18o1DmzrZHITysqSAKTD6ngei8HwlHtfNQ84Y+5VCS2f1lrPtZ6\nx22HJFWPkNT7UsLjipKl+wa2EaoYb4BydcxTJ7rfkld84G22QIDAQAB\nAoGBAJiSozntTHK2NvNev/cKzzGsWBaqHMFODXFvcN+AXBySADi3Ph8lbLTfaFZ8\nsT4Y5vyh9y9DNx38M+tyuamKC4DFvq/S8JaIJz6r+YO2toFN+kTac+PiNjthzWm//ulW/Da7wOYn68R2OU9kFlJfrN\n0aLA5Ij3MQJBAM9DfLdxZ9F2fghk9v2yORM7QEHaL5uXgPKuCL1zDgpq7IrK3HsC\n6S0WQ9USresoEAjG2bksLisuffTqBpJsICkCQQCJrXOIRq5Q8P6FIltegTZPEzCR\n3q8BbaDEEy2jOina2pDkpWPuiH/2h6BJv7rRwHqZMhvtLM43JV7+kCNWEe9hAkA2\nIH7CfWhKaHJziMKD8HY9Unzudad3L7KqLc70gsaI6/GIMYAw08rHTog6bd1jixvc\n3ulfFW2dM1ALlM5QkNI5AkBcKjscLK/+Zeg5t7llFL9whYtpSXLN1dYROVK6llvV\nXIo4XfGPr31Sg0QmItbYdjOoOKFF+1gaVrnMNt2umg15\n-----END RSA PRIVATE KEY-----\n", "user_id": "test", "name": "testKeyName", "fingerprint": "9b:33:48:we:26:7f:es:6b:c3:e1:d2:ec:eb:ad:13:31"}}

Andy Chong (andycjw)
Changed in horizon:
status: Incomplete → Invalid
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.