misleading "key_name" API validation message complains about "name"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Medium
|
jichenjc |
Bug Description
I think this was working in Kilo but broken in Newton.
When I submit a POST to create a new node, and the POST JSON has "key_name": null, I get an HTTP 400 error.
For example:
curl -i -X POST -H 'Host: example.com:13774' -H 'X-LC-Request-ID: 139827913935568' -H 'Accept-Encoding: gzip,deflate' -H 'X-Auth-Token: <mytoken>' -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json' -H 'User-Agent: libcloud/2.0.0 (OpenStack) ' --data-binary '{"server": {"name": "kdreyer-test", "imageRef": "ac47d004-
400 Bad Request
Openstack-
X-Openstack-
Vary: OpenStack-
Content-Type: application/json; charset=UTF-8
Content-Length: 159
X-Compute-
Date: Tue, 27 Jun 2017 18:56:28 GMT
{"badRequest": {"message": "An invalid 'name' value was provided. The name must be: printable characters. Can not start or end with whitespace.", "code": 400}}
Omitting the key_name parameter entirely allows the request to succeed.
The problem is that the API error from Nova is complaining about "name", when it should be "key_name" instead. I spent a long time wondering what was wrong with my innocuous node name there.
tags: | added: api openstack-version.newton |
Changed in nova: | |
assignee: | nobody → jichenjc (jichenjc) |
This is going to take some unwinding of the schema validation code. The level of reuse there definitely doesn't make it clear how you'd specify which name in a big object is failing.