Browser: Grey page after login

Hi

I updated by Raspbian from oldstable to stable and with it I went from oh3 to oh4.0.1 I use nginx and a reverse proxy.

Migration worked ok so far (I assume), and openhab starts (as logs show). But I cannot login into OH anymore, neither from another computer nor on the raspi directly (localhost:8080). The login page is shown and:

  • If I enter wrong credentials, I get [WARN ] [uth.internal.AbstractAuthPageServlet] - Authentication failed from [0:0:0:0:0:0:0:1]: User not found: in /var/log/openhab/openhab.log
  • If I enter the correct credentials, the browser shows just an empty grey page and nothing is shown in /var/log/openhab/openhab.log

After searching here, I tried deleting all cookies corresponding to this host, but without any success.

How can I find out more about the problem, what happens, what’s the reason?

openhab-cli showlogs shows just nothing when I login with correct credentials, but openhab seems to run correctly otherwise, because I get many ab.event.ThingStatusInfoChangedEvent, openhab.event.ItemStateUpdatedEvent, …

Thanks.
Bernd

What’s the output of

cat /etc/os-release

and

java --version

?

cat /etc/os-release

PRETTY_NAME=“Raspbian GNU/Linux 12 (bookworm)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“12”
VERSION=“12 (bookworm)”
VERSION_CODENAME=bookworm
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“RaspbianForums - Raspbian
BUG_REPORT_URL=“RaspbianBugs - Raspbian

java --version

openjdk 17.0.6 2023-01-17
OpenJDK Runtime Environment (build 17.0.6+10-Raspbian-1rpi1)
OpenJDK Client VM (build 17.0.6+10-Raspbian-1rpi1, mixed mode, emulated-client)

I just truncated the openhab.log file and restarted OH4:

023-08-12 10:38:06.388 [INFO ] [org.openhab.core.Activator          ] - Starting openHAB 4.0.1 (build Release Build)
2023-08-12 10:38:07.157 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Zurich'.
2023-08-12 10:38:07.172 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '47.25322666105025,8.608962893486025'.
2023-08-12 10:38:07.174 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'gsw_CH'.
2023-08-12 10:38:10.544 [ERROR] [core.io.rest.auth.internal.JwtHelper] - Error while initializing the JWT helper
java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null
        at java.io.StringReader.<init>(StringReader.java:51) ~[?:?]
        at org.jose4j.json.internal.json_simple.parser.JSONParser.parse(JSONParser.java:77) ~[?:?]
        at org.jose4j.json.JsonUtil.parseJson(JsonUtil.java:62) ~[?:?]
        at org.jose4j.jwk.JsonWebKey$Factory.newJwk(JsonWebKey.java:292) ~[?:?]

[...]
2023-08-12 10:38:10.609 [ERROR] [core.io.rest.auth.internal.JwtHelper] - bundle org.openhab.core.io.rest.auth:4.0.1 (176)[org.openhab.core.io.rest.auth.internal.JwtHelper(155)] : Error during instantiation of the implementation object
java.lang.reflect.InvocationTargetException: null
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]

[...]
2023-08-12 10:38:10.665 [WARN ] [openhab.core.io.rest.auth.AuthFilter] - bundle org.openhab.core.io.rest.auth:4.0.1 (176)[org.openhab.core.io.rest.auth.AuthFilter(154)] : Could not get service from ref {org.openhab.core.io.rest.auth.internal.JwtHelper}={service.id=301, service.bundleid=176, service.scope=bundle, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), component.name=org.openhab.core.io.rest.auth.internal.JwtHelper, component.id=155}
2023-08-12 10:38:10.667 [ERROR] [openhab.core.io.rest.auth.AuthFilter] - bundle org.openhab.core.io.rest.auth:4.0.1 (176)[org.openhab.core.io.rest.auth.AuthFilter(154)] : Error during instantiation of the implementation object: Unable to get service for reference $000
2023-08-12 10:38:10.674 [WARN ] [rd.internal.AriesJaxrsServiceRuntime] - Extension from reference CachingServiceReference {
cachedProperties={osgi.jaxrs.application.select=(osgi.jaxrs.name=openhab), service.id=302, objectClass=[javax.ws.rs.container.ContainerRequestFilter, org.openhab.core.io.rest.auth.AuthFilter], osgi.jaxrs.name=null (cached), osgi.jaxrs.extension.select=null (cached), osgi.jaxrs.whiteboard.target=null (cached)}
serviceReference={javax.ws.rs.container.ContainerRequestFilter, org.openhab.core.io.rest.auth.AuthFilter}={service.id=302, service.bundleid=176, service.scope=bundle, osgi.jaxrs.application.select=(osgi.jaxrs.name=openhab), allowBasicAuth=true, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), component.name=org.openhab.core.io.rest.auth.AuthFilter, service.config.label=API Security, component.id=154, service.config.factory=false, osgi.jaxrs.extension=true, service.config.category=system, service.config.description.uri=system:restauth, service.pid=[org.openhab.restauth, org.openhab.restauth]}
} can't be got
2023-08-12 10:38:10.678 [ERROR] [core.io.rest.auth.internal.JwtHelper] - Error while initializing the JWT helper
java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null
        at java.io.StringReader.<init>(StringReader.java:51) ~[?:?]
        at org.jose4j.json.internal.json_simple.parser.JSONParser.parse(JSONParser.java:77) ~[?:?]
[...]
2023-08-12 10:38:10.689 [ERROR] [core.io.rest.auth.internal.JwtHelper] - bundle org.openhab.core.io.rest.auth:4.0.1 (176)[org.openhab.core.io.rest.auth.internal.JwtHelper(155)] : Error during instantiation of the implementation object
java.lang.reflect.InvocationTargetException: null
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
[...]
2023-08-12 10:38:11.281 [WARN ] [.io.rest.auth.internal.TokenResource] - bundle org.openhab.core.io.rest.auth:4.0.1 (176)[org.openhab.core.io.rest.auth.internal.TokenResource(157)] : Could not get service from ref {org.openhab.core.io.rest.auth.internal.JwtHelper}={service.id=301, service.bundleid=176, service.scope=bundle, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), component.name=org.openhab.core.io.rest.auth.internal.JwtHelper, component.id=155}
2023-08-12 10:38:11.282 [ERROR] [.io.rest.auth.internal.TokenResource] - bundle org.openhab.core.io.rest.auth:4.0.1 (176)[org.openhab.core.io.rest.auth.internal.TokenResource(157)] : Error during instantiation of the implementation object: Unable to get service for reference $001
2023-08-12 10:38:11.286 [WARN ] [rd.internal.AriesJaxrsServiceRuntime] - Resource from reference CachingServiceReference {
cachedProperties={osgi.jaxrs.application.select=(osgi.jaxrs.name=openhab), osgi.jaxrs.name=auth, osgi.jaxrs.extension.select=(osgi.jaxrs.media.type=application/json), osgi.jaxrs.whiteboard.target=null (cached)}
serviceReference={org.openhab.core.io.rest.RESTResource, org.openhab.core.io.rest.auth.internal.TokenResource}={osgi.jaxrs.resource=true, service.id=304, service.bundleid=176, service.scope=bundle, osgi.jaxrs.application.select=(osgi.jaxrs.name=openhab), osgi.jaxrs.name=auth, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), osgi.jaxrs.extension.select=(osgi.jaxrs.media.type=application/json), component.name=org.openhab.core.io.rest.auth.internal.TokenResource, component.id=157}
} can't be got
2023-08-12 10:38:11.888 [WARN ] [org.openhab.core.net.NetUtil        ] - Found multiple local interfaces - ignoring 192.168.178.130
2023-08-12 10:38:12.021 [WARN ] [.io.websocket.CommonWebSocketServlet] - bundle org.openhab.core.io.websocket:4.0.1 (186)[org.openhab.core.io.websocket.CommonWebSocketServlet(187)] : Could not get service from ref {javax.ws.rs.container.ContainerRequestFilter, org.openhab.core.io.rest.auth.AuthFilter}={service.id=302, service.bundleid=176, service.scope=bundle, osgi.jaxrs.application.select=(osgi.jaxrs.name=openhab), allowBasicAuth=true, osgi.ds.satisfying.condition.target=(osgi.condition.id=true), component.name=org.openhab.core.io.rest.auth.AuthFilter, service.config.label=API Security, component.id=154, service.config.factory=false, osgi.jaxrs.extension=true, service.config.category=system, service.config.description.uri=system:restauth, service.pid=[org.openhab.restauth, org.openhab.restauth]}
2023-08-12 10:38:12.022 [ERROR] [.io.websocket.CommonWebSocketServlet] - bundle org.openhab.core.io.websocket:4.0.1 (186)[org.openhab.core.io.websocket.CommonWebSocketServlet(187)] : Error during instantiation of the implementation object: Unable to get service for reference $000
2023-08-12 10:38:14.564 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'jdbc.persist'
[...]

Doesn’t look good, I think… But why / what happened? OH3 had been in use for over a year without any such problems, than I upgraded (both system to new stable and OH to 4.0.1).

Unfortunately, by searching for this error messages here in the forum I didn’t find much being helpful :frowning:

Just restored a backup of OH 3, during start of OH 4 I get the exact same errors.

Also interesting: I had some persistence config in order to store data in a postgresql db; this is gone, instead I got many files within /var/lib/openhab/persistence/rrd4j/

Hm. Although it might not help to get rid of the problem, it might be better to stick to bullseye as long as bookworm isn’t stable yet.
Please be aware that best practice is openHABian Image on a Raspberry Pi (which is Raspberry Pi OS lite, 32Bit preferred for maximal compatibility).

If you have a current backup, the simplest option is to start from scratch. If the backup is openHAB3.x, please start with a openHAB3.4.5 version, then restore data, ensure everything works as planned, then ensure Java17 is already installed and is the preferred version (update-alternatives), then upgrade to openHAB4.
During the upgrade make sure that every file from package is used, there may be some changed files which then won’t be touched, but apt will ask.

OK, first thing I learned: while Debian Bookworm is stable since 10.06.2023, Raspbian stable is still Bullseye, and last time (i.e… for Bullseye), Raspbian Bullseye got stable about 5 months after Debian Bullseye. So having all my computers running Bookworm now means PC/Laptop are on stable, but Raspi is on testing. Pitfall? Lesson learned :slight_smile:

systemctl stop openhab
systemctl disable openhab
apt remove --purge openhab
apt-cache madison openhab
apt install openhab=3.4.5-1

openhab-cli restore /tmp/openHABv3.zip
 Backup Information:
 -------------------
 Backup Version         | 3.4.2 (You are on 3.4.5)

systemctl enable openhab
systemctl start openhab

Same error message in openhab.log:

2023-08-14 10:20:43.483 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'jdbc.persist'
2023-08-14 10:20:43.789 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'jdbc.persist' has errors, therefore ignoring it: [1,1]: mismatched input '<EOF>' expecting 'Strategies'
2023-08-14 10:20:51.023 [ERROR] [core.io.rest.auth.internal.JwtHelper] - Error while initializing the JWT helper

And I get the grey screen after login into openhab.

systemctl stop openhab
systemctl disable openhab
apt remove --purge openhab
apt-cache madison openhab
apt install openhab=3.4.2-1

openhab-cli restore /tmp/openHABv3.zip
 Backup Information:
 -------------------
 Backup Version         | 3.4.2 (You are on 3.4.2)
2023-08-14 10:37:38.600 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'jdbc.persist'
2023-08-14 10:37:38.875 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'jdbc.persist' has errors, therefore ignoring it: [1,1]: mismatched input '<EOF>' expec
ting 'Strategies'
[...]
2023-08-14 10:37:44.679 [ERROR] [core.io.rest.auth.internal.JwtHelper] - Error while initializing the JWT helper

So basically the same thing even with the very same version of openhab as before the update.

What’s that JWT helper-error? Next lines read:

java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null
        at java.io.StringReader.<init>(StringReader.java:51) ~[?:?]
        at org.jose4j.json.internal.json_simple.parser.JSONParser.parse(JSONParser.java:79) ~[?:?]

but why? /var/lib/openhab/jsondb/users.json looks very ok for me.

Seems like the whole thing isn’t related to OH 4 vs 3 at all…

Somehow related: there’s something I don’t understand about OH backups:

I remember (*) having set up persistence in /etc/openhab/persistence/jdbc.persist, but in my backup conf/persistence/jdbc.persist empty.

(*) it’s more than just remembering: my whole /etc is in git so I can see that jdbc.persist got “emptied” when I updated to OH 4, but why is this file empty in OH3’s zipped backup?

OK, I think I have at least a reasonable explanation for what might have happened:

I have to go back in my monthly backups to June 2022 in order to find a backup that can be restored such that OH3 starts correctly. Also this is the last backup with an non-empty jdbc.persist file. I assume that due to the steadily increasing backup size I ran into disk full when my OH backups were created. On a headless system… I backed up my corrupted backup files safely, at least :wink: (this is what I checked from time to time).

Unfortunately, I put /etc/openhab into git, but not /var/lib/openhab (well, that’s what OH’s backup is for, one could argue).

Good to know, and lesson learned, for sure…

Luckily, I ran OH in a multi-month test before using it in a really productive environment in the future, so I might just start over now.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.