cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

UI: Login failed after session timeout

Open vdombrovski opened this issue 3 years ago • 12 comments

ISSUE TYPE
  • Bug Report
COMPONENT NAME
UI
CLOUDSTACK VERSION
4.17.0.1
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

After a session timeout, the user is returned to the login screen. Whatever credentials are entered, the login will always fail with "Login failed", until the page is reloaded.

STEPS TO REPRODUCE
Log into your Cloudstack account
Wait for session timeout (whenever a click returns you to the login screen)
Try to log in again
EXPECTED RESULTS
Successful login with valid credentials
ACTUAL RESULTS
"Login failed" error message

vdombrovski avatar Sep 12 '22 12:09 vdombrovski

@vdombrovski I tried with latest from 4.17 branch and I can log on immediately after timeout, without cache clean, reload or anything. Can you try latest?

DaanHoogland avatar Sep 12 '22 15:09 DaanHoogland

Hi I can confirm Vladimir behavior, I have the same issue +1

bragonznx avatar Sep 14 '22 09:09 bragonznx

Hi. I tried with the latest 4.17 branch but no error like above. Can you give me a picture or video of the steps to make the above error?

utchoang avatar Sep 15 '22 02:09 utchoang

@utchoang not sure if the same issue but I was able to reproduce something similar. But this was seen only on installed env and I was not able to reproduce when UI is run locally with npm run serve. UI Login Failure.webm Could be related to #5663

shwstppr avatar Sep 15 '22 08:09 shwstppr

@shwstppr Your problem I'm not sure is the same as @AA's. But in your case, for the main branch (not in the 4.17 branch), there is an error from Console.vue, which causes error and does not initialize sourceToken (image below). Fixed in https://github.com/apache/cloudstack/pull/6741 image

utchoang avatar Sep 15 '22 09:09 utchoang

@utchoang I was using an env from 4.17 branch. Will try to check and see if I can provide something useful

shwstppr avatar Sep 15 '22 10:09 shwstppr

Did some more testing; Here is a way to reproduce one of the possible issues:

  1. Open 2 tabs inside your browser and go to login page on both
  2. Log into ACS with your user on one tab
  3. Try to log into ACS with the same (or any user) from another tab
  4. Your page will display 'Login failed', and in the console you will be getting "Uncaught (in promise) r {message: undefined}"

Tried on 4.17.0.1, didn't try any other releases.

vdombrovski avatar Sep 16 '22 11:09 vdombrovski

@shwstppr sounds like a blocker/critical issue? @vdombrovski does it help if you clean your site data (I use Chrome -> developer tools -> Application tab -> clear site data)?

rohityadavcloud avatar Sep 16 '22 12:09 rohityadavcloud

@rohityadavcloud I guess not a blocker because login starts working (atleast in my tests) once refresh the page in browser.

shwstppr avatar Sep 16 '22 13:09 shwstppr

I tried following steps like @vdombrovski but didn't notice the problem. Maybe I'm doing it wrong or maybe it's a browser bug (I did it on Chrome Version 105.0.5195.102). @shwstppr can you make the same error :( check_error_login

utchoang avatar Sep 19 '22 02:09 utchoang

@utchoang will check. I was able to reproduce similar console error with an installed env. Though same error is not seen in dev run using npm run serve

shwstppr avatar Sep 20 '22 07:09 shwstppr

Could you try an installed version of 4.17.0.1 and also 4.17.1.0 @shwstppr ?

rohityadavcloud avatar Sep 20 '22 08:09 rohityadavcloud

I'd like to report the same issue on 4.17.0.1 and I can reproduce it reliably (I think).

I'm able to log in and log out as expected. However, if I navigate to the profile page (this seems to trigger it reliably), then log out, I'm unable to log in again unless I do a full page reload. When this does happen, the login page will show a notification stating "Unauthorized / Session expired, authorization verification failed."

Working: working

Broken. Only difference is I navigate to the profile page before logging out: broken

Are you able to replicate this issue on your end?

kohrar avatar Sep 29 '22 21:09 kohrar

I think there's something in the UI code that's requesting for listResourceIcon after the logout occurs in some instances which triggers this issue.

After navigating to the profile page and logging out, I see that the browser sent the following request, only to get a 401 Unauthorized reply, which then causes an unhandled JS exception which then breaks the UI.

GET /client/api/?resourceids=a03c9ece-9b15-4638-a1d4-ee9e05edf81f&resourcetype=domain&command=listResourceIcon&response=json HTTP/1.1

JS Console shows:

       Uncaught (in promise) Error: Request failed with status code 401
    at e.exports (createError.js:16:15)
    at e.exports (settle.js:17:12)
    at XMLHttpRequest.c (xhr.js:54:7)

Subsequent login attempts just error out immediately, without any HTTP requests ever being made.

kohrar avatar Sep 29 '22 22:09 kohrar