openHAB version: 4.2.1 (official openhab docker image, running via docker-compose, openhab.yml as stated on hub.docker.com)
Dear all,
I have troubles logging into the WebUI since some months. Due to summer time there was not much time for debugging, but now weather is bad enough to have a deeper look, unfortunately without success.
What is happening:
Openhab itself is working as expected
After restarting Openhab, I’m able to log into the WebUI and can all the stuff as expected (role: administrator)
After log out, I can’t login any more, no matter what I do: after entering my credentials, the browser reloads the page without logging in
same behavior in Firefox and Safari on two different Mac Books, Firefox under Linux Ubuntu
I don’t get login related messages in the console at all
Adding or removing users from karaf console throws error:
11:48:25.533 [ERROR] [ab.core.io.console.ConsoleInterpreter] - An error occurred while executing the console command.
java.lang.NumberFormatException: For input string: "._1714151944366"
However, adding or removing users is performed in users.json. Logging in with the new users results in same behavior described above.
I’m struggling now for several hours and I dont’t know what else I can do. Anyone out there? Any hint would be highly appreciated!
Sorry, forgot to mention: I have indeed an nginx reverse proxy running. However, same behavior when I call the IP and port directly (http://192.168.178.4:8080).
Nothing special, except the mysterious input string as already seen in the karaf logging, see screenshot. No clue where this comes from and neither if it means something.
Edit: same answer with direct URL or via nginx reverse proxy.
Did you also delete all the backups of the file in the jsondb/backup/-folder? Otherwise I would try that first, sounds like something could have been corrupted in there.
Not all, but the user related. After deleting the user.json and the related backups, OH was asking me to create an admin account, but I was not able to do so. There was an other error message in the browser window, something like
HTTP ERROR 500 java.lang.IllegalStateException: ManagedProvider is not available
Any other ideas? It’s annoying, because I’m not really able to do some work on my system
You mean after deleting users.json and the related backups? I haven’t recognized such, but I didn’t really searched after, since there are thousands and thousands lines of logs during startup. I’ll check this later.
Stranges things happened.
I fingered around a little while in the karaf console, changing user passwords, and all of ad sudden I was able to log in, log out and log in again with another user, which was not possible before. Now I can again log in with my standard admin account … I absolutely don’t know, why this happened. The string “._1714151944366” does also not appear anymore in the logs neither the network console of the browser.
However, the users.json is no only 2 Bytes of size and contains just “{}#”.
After restarting Openhab in this state, the WebUI was asking me to create a first user. Now I was able to do so. The users.jsons now looks pretty normal and I’m able to log off and on again. Seems that there really was something corrupted in the user database.
Thanks a lot for your help, @pacive!