uaa icon indicating copy to clipboard operation
uaa copied to clipboard

Misleading error message when the UAA server is overloaded by too many concurrent logins

Open n4wei opened this issue 8 years ago • 3 comments

SECURITY NOTICE: If you have found a security problem in the UAA, please do not file a public github issue. Instead, please send an email to [email protected]

Thanks for taking the time to file an issue. You'll minimize back and forth and help us help you more effectively by answering all of the following questions as specifically and completely as you can.

What version of UAA are you running?

v53

What output do you see from curl <YOUR_UAA>/info -H'Accept: application/json'

{"app":{"version":"4.8.0"},"links":{"uaa":"https://uaa.hardknox.cli.fun","passwd":"/forgot_password","login":"https://login.hardknox.cli.fun","register":"/create_account"},"zone_name":"uaa","entityID":"login.hardknox.cli.fun","commit_id":"391163e","idpDefinitions":{},"prompts":{"username":["text","Email"],"password":["password","Password"]},"timestamp":"2017-12-04T10:33:28-0800"}

How are you deploying the UAA?

I am deploying the UAA

  • using cf-deployment v1.3.1

What did you do?

If possible, provide a recipe for reproducing the error. Exact curl or uaac commands with verbose output are helpful. If your problem is configuration-related, please include portions of your uaa.yml or bosh deployment manifest that you believe may be relevant (but do not divulge secrets!)

We are running cf auth in our CI pipelines concurrently on 16 nodes (against 2 instances of UAA running on "minimal" sized GCP VMs). Here's a verbose output of the error we encountered:

$ cf auth <some-username> <some-pw> -v 
...
OUT: REQUEST: [2017-12-13T22:48:04Z]
OUT: POST /oauth/token HTTP/1.1
OUT: Host: login.beque.cli.fun
OUT: Accept: application/json
OUT: Authorization: [PRIVATE DATA HIDDEN]
OUT: Connection: close
OUT: Content-Type: application/x-www-form-urlencoded
OUT: User-Agent: cf/6.33.0+2e15ea845.2017-12-13 (go1.9.2; amd64 linux)
OUT: [PRIVATE DATA HIDDEN]
OUT: 
OUT: RESPONSE: [2017-12-13T22:48:09Z]
OUT: HTTP/1.1 401 Unauthorized
OUT: Alt-Svc: clear
OUT: Cache-Control: no-cache, no-store, max-age=0, must-revalidate
OUT: Cache-Control: no-store
OUT: Content-Length: 80
OUT: Content-Type: application/json;charset=UTF-8
OUT: Date: Wed, 13 Dec 2017 22:48:08 GMT
OUT: Expires: 0
OUT: Pragma: no-cache
OUT: Pragma: no-cache
OUT: Strict-Transport-Security: max-age=31536000 ; includeSubDomains
OUT: Via: 1.1 google
OUT: Www-Authenticate: Basic realm="UAA/client", error="unauthorized", error_description="System resources busy. Try again."
OUT: X-Content-Type-Options: nosniff
OUT: X-Frame-Options: DENY
OUT: X-Vcap-Request-Id: e3aac1c1-6ae7-48ff-73b8-1d972c29ea94
OUT: X-Xss-Protection: 1; mode=block
OUT: {
OUT:   "error": "unauthorized",
OUT:   "error_description": "System resources busy. Try again."
OUT: }
OUT: 
OUT: 
ERR: Credentials were rejected, please try again.
OUT: FAILED

What did you expect to see? What goal are you trying to achieve with the UAA?

What I did not expect to see was a "401" HTTP response code, and the "error": "unauthorized" which seems to suggest that something is wrong with the credentials we provided (we tested out the credentials and they are correct). It seems that the error is actually because system resources are busy. Perhaps this should be a 500 level HTTP status code with a different "error" value.

Please know that in the cf cli, we wrap the error returned by the UAA server by looking at the "error" value and the HTTP status code. Hence in this case we wrapped the error and displayed "Credentials were rejected, please try again." back to the user. In this case we should use a different HTTP status code and "error" value to display a different wrapped cf cli error message.

Please include UAA logs if available.

n4wei avatar Dec 14 '17 00:12 n4wei

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/153655376

The labels on this github issue will be updated when the story is started.

cf-gitbot avatar Dec 14 '17 00:12 cf-gitbot

makes sense, the http status return code should be unavailable (503)

the message should look like

 {
    "error": "unavailable",
    "error_description": "System resources busy. Try again."
 }

fhanik avatar Dec 26 '17 20:12 fhanik

Closing due to inactivity.

shamus avatar May 22 '20 23:05 shamus