← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1700825] [NEW] misleading "key_name" API validation message complains about "name"

 

Public bug reported:

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
-c15c-4eb5-a205-ec8beda806e5", "key_name": null, "flavorRef": "2",
"metadata": {}, "personality": []}}' --compress
https://example.com:13774/v2.1/servers

400 Bad Request
Openstack-Api-Version: compute 2.1
X-Openstack-Nova-Api-Version: 2.1
Vary: OpenStack-API-Version, X-OpenStack-Nova-API-Version
Content-Type: application/json; charset=UTF-8
Content-Length: 159
X-Compute-Request-Id: req-de6f1fc0-f403-4579-bfa3-e4ce031bcd91
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.

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1700825

Title:
  misleading "key_name" API validation message complains about "name"

Status in OpenStack Compute (nova):
  New

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-c15c-4eb5-a205-ec8beda806e5", "key_name": null, "flavorRef":
  "2", "metadata": {}, "personality": []}}' --compress
  https://example.com:13774/v2.1/servers

  400 Bad Request
  Openstack-Api-Version: compute 2.1
  X-Openstack-Nova-Api-Version: 2.1
  Vary: OpenStack-API-Version, X-OpenStack-Nova-API-Version
  Content-Type: application/json; charset=UTF-8
  Content-Length: 159
  X-Compute-Request-Id: req-de6f1fc0-f403-4579-bfa3-e4ce031bcd91
  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1700825/+subscriptions