apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2k stars 1.09k forks source link

UI stuck #9296

Closed UAnton closed 3 months ago

UAnton commented 3 months ago
ISSUE TYPE
COMPONENT NAME
UI
CLOUDSTACK VERSION
4.19.1
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 22.04
SUMMARY
STEPS TO REPRODUCE
Login with the wrong password. After that UI stuck on login. In the DevTools: 
_Failed to load resource: the server responded with a status of 401 (Unauthorized)_
EXPECTED RESULTS
Error about wrong password and login screen
ACTUAL RESULTS
Stuck loading UI
boring-cyborg[bot] commented 3 months ago

Thanks for opening your first issue here! Be sure to follow the issue template!

rohityadavcloud commented 3 months ago

Thanks for sharing the issue @UAnton I've found the login with wrong password causes exception on the backend and the API returns HTTP 200. Unfortunately, when this happens some cookies are set, and the current workaround is to close/open the browser or use dev tools to clear storage and reload UI.

@harikrishna-patnala @sureshanaparti @shwstppr in a 4.19.0.1 env and on the qa server, I could reproduce the issue by logging with wrong username/password and get this:

2024-06-24 21:07:26,925 DEBUG [c.c.a.ApiServlet] (qtp210156003-546:ctx-2bb86b07) (logid:5b69db2e) ===START===  192.168.2.200 -- GET  command=logout&response=json
2024-06-24 21:07:26,926 DEBUG [c.c.a.ApiServlet] (qtp210156003-546:ctx-2bb86b07) (logid:5b69db2e) ===END===  192.168.2.200 -- GET  command=logout&response=json
2024-06-24 21:07:26,927 DEBUG [c.c.a.ApiServlet] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) ===START===  192.168.2.200 -- POST
2024-06-24 21:07:26,927 DEBUG [c.c.a.ApiSessionListener] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Session created by Id : node01or3j0ciyly0kmxqhrcbsuupk1 , session: Session@7985e868{id=node01or3j0ciyly0kmxqhrcbsuupk1,x=node01or3j0ciyly0kmxqhrcbsuupk1.node0,req=1,res=true} , source: Session@7985e868{id=node01or3j0ciyly0kmxqhrcbsuupk1,x=node01or3j0ciyly0kmxqhrcbsuupk1.node0,req=1,res=true} , event: javax.servlet.http.HttpSessionEvent[source=Session@7985e868{id=node01or3j0ciyly0kmxqhrcbsuupk1,x=node01or3j0ciyly0kmxqhrcbsuupk1.node0,req=1,res=true}]
2024-06-24 21:07:26,929 DEBUG [o.a.c.v.s.VMSchedulerImpl] (VMSchedulerPollTask:ctx-5b940a74) (logid:4dce0199) Got 0 scheduled jobs to be executed at 2024-06-24 15:37:00 GMT
2024-06-24 21:07:26,929 DEBUG [c.c.u.AccountManagerImpl] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Attempting to log in user: admin in domain 1
2024-06-24 21:07:26,930 DEBUG [o.a.c.s.a.PBKDF2UserAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Retrieving user: admin
2024-06-24 21:07:26,943 INFO  [o.a.c.v.s.VMSchedulerImpl] (VMSchedulerPollTask:ctx-5b940a74) (logid:4dce0199) Cleaned up 0 VM scheduled job entries
2024-06-24 21:07:26,946 DEBUG [o.a.c.c.ClusterDrsServiceImpl] (VMSchedulerPollTask:ctx-e7d925c5) (logid:7e66487b) ClusterDRS.poll is being called at 2024-06-24 15:37:00 GMT
2024-06-24 21:07:26,969 DEBUG [c.c.v.VirtualMachineManagerImpl] (Vm-Operations-Cleanup-1:ctx-4a333422) (logid:ab8a9341) VM Operation Thread Running
2024-06-24 21:07:26,998 DEBUG [o.a.c.c.ClusterDrsServiceImpl] (VMSchedulerPollTask:ctx-e7d925c5) (logid:7e66487b) Removed 0 old drs migration plans
2024-06-24 21:07:27,061 DEBUG [c.c.a.m.AgentManagerImpl] (AgentManager-Handler-14:null) (logid:) Ping from Routing host 26(kvm1.onprem.in)
2024-06-24 21:07:27,061 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-14:null) (logid:) Process host VM state report from ping process. host: 26
2024-06-24 21:07:27,063 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-14:null) (logid:) Process VM state report. host: 26, number of records in report: 3
2024-06-24 21:07:27,063 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-14:null) (logid:) VM state report. host: 26, vm id: 3, power state: PowerOn
2024-06-24 21:07:27,063 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-14:null) (logid:) VM state report. host: 26, vm id: 5, power state: PowerOn
2024-06-24 21:07:27,064 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-14:null) (logid:) VM state report. host: 26, vm id: 796, power state: PowerOn
2024-06-24 21:07:27,065 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-14:null) (logid:) Done with process of VM state report. host: 26
2024-06-24 21:07:27,114 DEBUG [o.a.c.a.SHA256SaltedUserAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Retrieving user: admin
2024-06-24 21:07:27,115 WARN  [o.a.c.a.SHA256SaltedUserAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) The stored password for admin isn't in the right format for this authenticator
2024-06-24 21:07:27,115 DEBUG [o.a.c.a.MD5UserAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Retrieving user: admin
2024-06-24 21:07:27,116 DEBUG [o.a.c.a.MD5UserAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Password does not match
2024-06-24 21:07:27,116 DEBUG [o.a.c.l.LdapAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Retrieving ldap user: admin
2024-06-24 21:07:27,117 DEBUG [o.a.c.s.SAML2UserAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Trying SAML2 auth for user: admin
2024-06-24 21:07:27,118 DEBUG [o.a.c.s.SAML2UserAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Unable to find user with admin in domain 1, or user source is not SAML2
2024-06-24 21:07:27,118 DEBUG [o.a.c.o.OAuth2UserAuthenticator] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) Trying OAuth2 auth for user: admin
2024-06-24 21:07:27,120 ERROR [c.c.a.ApiServlet] (qtp210156003-535:ctx-52e9ad21) (logid:d7cf20cb) unknown exception writing api response
com.cloud.utils.exception.CloudRuntimeException: OAuth2 authentication provider name is empty
    at org.apache.cloudstack.oauth2.OAuth2AuthManagerImpl.getUserOAuth2AuthenticationProvider(OAuth2AuthManagerImpl.java:105)
    at org.apache.cloudstack.oauth2.OAuth2UserAuthenticator.authenticate(OAuth2UserAuthenticator.java:65)
    at com.cloud.user.AccountManagerImpl.getUserAccount(AccountManagerImpl.java:2656)
    at com.cloud.user.AccountManagerImpl.authenticateUser(AccountManagerImpl.java:2494)
vishesh92 commented 3 months ago

@UAnton It's a bug in 4.19.0 release. Already reported here: https://github.com/apache/cloudstack/issues/8662 This has been fixed (https://github.com/apache/cloudstack/pull/8671) and will be released as part of 4.19.1.