← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1455298] [NEW] unreasonable error message returned when an empty body was posted to POST request

 

Public bug reported:

For now, if a POST request with an empty body,  the bad request message
will return a code-level error info, this is unfriendly to end users.

The curl request of a POST request with a empty body:

curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X POST
http://10.250.10.15:35357/v2.0/users -H "Content-Type: application/json"
-H "Accept: application/json" -H "X-Auth-Token:
b648b3deb12d4f3bb114a303eb153507" -d '{}'

the return message:

{"error": {"message": "create_user() takes exactly 3 arguments (2
given)", "code": 400, "title": "Bad Request"}}

The others keystone API has the same issue.

the reasonable return of a this type request is like this:

curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X POST
http://10.250.10.15:8776/v2/30be1fc9a03c4e94ab05c403a8a377f2/volumes -H
"User-Agent: python-cinderclient" -H "Content-Type: application/json" -H
"Accept: application/json" -H "X-Auth-Token:
b648b3deb12d4f3bb114a303eb153507" -d '{}'

{"badRequest": {"message": "Missing required element 'volume' in request
body", "code": 400}}

** Affects: keystone
     Importance: Undecided
     Assignee: Liusheng (liusheng)
         Status: New

** Changed in: keystone
     Assignee: (unassigned) => Liusheng (liusheng)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1455298

Title:
  unreasonable error message returned when an empty body was posted to
  POST request

Status in OpenStack Identity (Keystone):
  New

Bug description:
  For now, if a POST request with an empty body,  the bad request
  message will return a code-level error info, this is unfriendly to end
  users.

  The curl request of a POST request with a empty body:

  curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X POST
  http://10.250.10.15:35357/v2.0/users -H "Content-Type:
  application/json" -H "Accept: application/json" -H "X-Auth-Token:
  b648b3deb12d4f3bb114a303eb153507" -d '{}'

  the return message:

  {"error": {"message": "create_user() takes exactly 3 arguments (2
  given)", "code": 400, "title": "Bad Request"}}

  The others keystone API has the same issue.

  the reasonable return of a this type request is like this:

  curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X POST
  http://10.250.10.15:8776/v2/30be1fc9a03c4e94ab05c403a8a377f2/volumes
  -H "User-Agent: python-cinderclient" -H "Content-Type:
  application/json" -H "Accept: application/json" -H "X-Auth-Token:
  b648b3deb12d4f3bb114a303eb153507" -d '{}'

  {"badRequest": {"message": "Missing required element 'volume' in
  request body", "code": 400}}

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


Follow ups

References