erwindon / SaltGUI

A web interface for managing SaltStack based infrastructure.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No longer able to log in

xzenor opened this issue · comments

Describe the bug
I can't log on to SaltGUI anymore. There's not even an error, it just empties the form fields and tells me 'not logged in'.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to the loginpage
  2. Enter credentials
  3. Choose PAM
  4. Click 'Login'
  5. Back to step 1

Expected behaviour
I expect to be able to log in as it did. This worked fine but for some reason it suddenly stopped working.
I did update SaltGUI and I did update my system packages

Screenshots
It's just a login screen with the message "Not logged in"
image

Additional context
I tried to connect with curl to the api to see if it's an issue with the External Authentication and that part still works as expected. I restarted, rebooted, reinstalled.. nothing helped. I tried the debug logging but my n00b eyes don't see anything out of the ordinary.
Sadly I'm not entirely sure when it went wrong so I can't link it to a package update or a SaltGUI update. I did run 3005 successfully for a little while with a working SaltGUI though so that was not the cause of this.

  • Salt version: 3005
  • OS: FreeBSD 13.1
  • Python version: 3.9

Here's a part of the api log that might help the first line grabbed my attention:

2022-09-07 20:42:56,144 [salt.loaded.int.netapi.rest_cherrypy.app:749 ][INFO    ][1685] [api_acl] Authentication not checked for user MYUSERNAME from IP 192.168.178.20
2022-09-07 20:42:56,158 [salt.channel.client:313 ][DEBUG   ][1685] Closing AsyncReqChannel instance
2022-09-07 20:42:56,159 [cherrypy.access.34452753808:291 ][INFO    ][1685] 192.168.178.20 - - [07/Sep/2022:20:42:56] "POST /login HTTP/1.1" 200 206 "https://salt.domainname:3333/?reason=no-session" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0"
2022-09-07 20:42:56,233 [salt.channel.client:313 ][DEBUG   ][1685] Closing AsyncReqChannel instance
2022-09-07 20:42:56,234 [salt.channel.client:313 ][DEBUG   ][1685] Closing AsyncReqChannel instance
2022-09-07 20:42:56,236 [salt.transport.ipc:373 ][DEBUG   ][1685] Closing IPCMessageSubscriber instance
2022-09-07 20:42:56,261 [salt.channel.client:313 ][DEBUG   ][1685] Closing AsyncReqChannel instance
2022-09-07 20:42:56,269 [salt.channel.client:313 ][DEBUG   ][1685] Closing AsyncReqChannel instance
2022-09-07 20:42:56,272 [cherrypy.access.34452753808:291 ][INFO    ][1685] 192.168.178.20 - - [07/Sep/2022:20:42:56] "POST / HTTP/1.1" 200 12992 "https://salt.domainname:3333/?reason=no-session" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0"
2022-09-07 20:42:56,274 [salt.channel.client:313 ][DEBUG   ][1685] Closing AsyncReqChannel instance
2022-09-07 20:42:56,280 [salt.channel.client:313 ][DEBUG   ][1685] Closing AsyncReqChannel instance
2022-09-07 20:42:57,207 [cherrypy.access.34452753808:291 ][INFO    ][1685] 192.168.178.20 - - [07/Sep/2022:20:42:57] "GET /static/salt-auth.txt HTTP/1.1" 404 663 "https://salt.domainname:3333/?reason=no-session" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0"
2022-09-07 20:42:57,209 [cherrypy.access.34452753808:291 ][INFO    ][1685] 192.168.178.20 - - [07/Sep/2022:20:42:57] "GET /static/salt-motd.txt HTTP/1.1" 404 663 "https://salt.domainname:3333/?reason=no-session" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0"
2022-09-07 20:42:57,212 [cherrypy.access.34452753808:291 ][INFO    ][1685] 192.168.178.20 - - [07/Sep/2022:20:42:57] "GET /static/salt-motd.html HTTP/1.1" 404 663 "https://salt.domainname:3333/?reason=no-session" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0"

@xzenor
"Not logged in" is an error that is detected on the client side.
In those cases, you can/should:

  • look at the "console" of the webbrowser to look for error messages
  • look at the "network" log from the browser to look at the results of individual API calls, in this case the "login" api-call should be the first and most related.

does the problem also occur with another browser?
either from a different location or just using a different brand (chrome/firefox/edge/etc) from the same location.

I'm using Debian 11.4 with salt 3004.2 for SaltGUI development without any problem.
I have separate VMs for all Salt versions from 2016.x to 3005, around 90 different versions. The VM for 3005 is now updated to the latest SaltGUI and it also has no problems.
SaltGUI does not hold any Python code. I have python 3.9.2 on both my development machine (the one with 3004.2) and on that test machine (the one with 3005).
I do not have test environments for other Linux/Unix versions because there was never a need for that.

I'm ashamed to say that this was a browser issue............
I cleaned the cache and that didn't help at all but once I deleted the cookies it started working again. Apologies for making a useless bugreport.

this was not a useless report.
SaltGUI should not fail its login procedure in the presence of some cookies.
It would be interesting to know which cookies caused that...

I'll see what I can do. I'm not sure if they're included in my backup but I'll look.

They were in my backup but restoring cookies.sqlite didn't change anything. it still works after restore. Sorry, I cannot reproduce it anymore.

never mind, thx for trying!