WebUI Logon only possible one time after restart

  • Platform information:
    • Hardware: HP Microserver Gen10, AMD Opteron™ X3216 AP, 8 GB RAM
    • OS: Debian 12
    • Java Runtime Environment: OpenJDK Runtime Environment (build 17.0.12+7-Debian-2deb12u1)
    • 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
  • Cleared browser cache
  • Cleared openhab cache (Clear the Cache)
  • Removed users.json (Openhab3 forgot password - #2 by wborn) → not worked at all, restoring old state afterwards
  • 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!

Thanks a lot
Christof

Do you have a reverse proxy set up, or do you connect to OH directly?

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).

Can you open the browser’s developer console (network tab) and see if you get any error responses?

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.

grafik

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 :frowning:

Are there any lines in openhab.log related to this when restarting OH? Sounds like something hasn’t loaded correctly.

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!

1 Like