I use an RPI3b+ on the latest Raspberry lite 64.
I used the Pi imager and set the OS up from scratch. Boots flawlessly.
The I try to use a plain (as provided) docker container - and fail.
++ cmp /openhab/userdata/etc/version.properties /openhab/dist/userdata/etc/version.properties
+ '[' '!' -z ']'
+ chown -R openhab:openhab /openhab
+ sync
+ '[' -d /etc/cont-init.d ']'
+ sync
+ '[' false == false ']'
++ IFS=' '
++ echo gosu openhab tini -s ./start.sh
+ '[' 'gosu openhab tini -s ./start.sh' == 'gosu openhab tini -s ./start.sh' ']'
+ command=($@ server)
+ exec gosu openhab tini -s ./start.sh server
Launching the openHAB runtime...
Aborted (core dumped)
Aborted (core dumped)
./runtime/bin/karaf: 247: [: Illegal number:
./runtime/bin/karaf: 97: [: Illegal number:
./runtime/bin/karaf: 300: [: Illegal number:
-Djava.endorsed.dirs=/usr/lib/jvm/temurin-11-jdk-arm64/jre/lib/endorsed:/usr/lib/jvm/temurin-11-jdk-arm64/lib/endorsed:/openhab/runtime/lib/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
console says:
pi@raspberrypi:~ $ docker attach pi-openhab-1
Aborted (core dumped)
./runtime/bin/karaf: 247: [: Illegal number:
Aborted (core dumped)
Aborted (core dumped)
./runtime/bin/karaf: 247: [: Illegal number:
./runtime/bin/karaf: 97: [: Illegal number:
./runtime/bin/karaf: 300: [: Illegal number:
-Djava.endorsed.dirs=/usr/lib/jvm/temurin-11-jdk-arm64/jre/lib/endorsed:/usr/lib/jvm/temurin-11-jdk-arm64/lib/endorsed:/openhab/runtime/lib/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Edit:
In th meantime I tried several other versions, last one working is 3.1.0.
3.2.0, 3.3.0 and 3.4.x do not start.
For me the arm64 image works without issues on a RPi 4 running Ubuntu 22.04.2.
I think the main difference between those OH versions is that Debian 11 is used as base image since OH 3.2 (instead of Debian 10).
Do other Debian 11 based images work properly for you?
The openjdk:11 image also uses Debian 11 and Java 11 so you could test if that works by just letting it print the Java version:
docker run --rm openjdk:11 java --version
If you run an old Raspberry Pi OS version as host OS it does not properly support time64. Java would also complain about this by printing “No monotonic clock was available”. But I would not expect this to be an issue if you run a recent bullseye based Raspberry Pi OS version.
I’ll keep trying on my end. I suspect it may have to do with me not providing my config folder to the docker. I started it straight from the dockerhub.
I was able to reproduce this on my own RPi 3. It looks like the JVM crashes and it also creates hs_err_pid log files in the userdata dir for this. Do you also have these? I’ll have to further investigate what’s causing these crashes.
As a workaround for now you could also try the Alpine image which does seem to work.
I am also experiencing this error on my Raspberry 3B+ running 64bit RaspiOS Debian Bullseye:
Launching the openHAB runtime...
Aborted (core dumped)
./runtime/bin/karaf: 247: [: Illegal number:
./runtime/bin/karaf: 97: [: Illegal number:
./runtime/bin/karaf: 300: [: Illegal number:
-Djava.endorsed.dirs=/usr/lib/jvm/temurin-11-jdk-arm64/jre/lib/endorsed:/usr/lib/jvm/temurin-11-jdk-arm64/lib/endorsed:/openhab/runtime/lib/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
openJDK runs fine in Docker:
$ docker run --rm openjdk:11 java --version
Status: Downloaded newer image for openjdk:11
openjdk 11.0.16 2022-07-19
OpenJDK Runtime Environment 18.9 (build 11.0.16+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.16+8, mixed mode, sharing)
If I switch the JVM from Temurin to the standard Debian OpenJDK it no longer seems to crash on my Raspberry Pi 3. You can test that change using the wborn/openhab:3.4.3 images I just uploaded.
I’m running on a linux box with Ubuntu 22.04 x64. I’ve been running some version of the same container for my production system since OH3.0 and never seen this issue until now.
Wonderful. I’ll give it a test after work today and report back.
I just tested this image with a duplicate of production my container and get the same error still. I have a second smaller container that I sometimes run but I’m seeing the same error in that one with any M4 images.
I do much of my docker admin with Portainer, and I’m aware of the ENV concern. I have never had to delete the old ENV vars to get image updates working, but just in case, I also tried this image on a duplicate of my container with just my custom ports and user and group IDs and I still get the same errors.
It could also be due to the Debian 12 base image update. I ran into some similar issues on another project while using Java in Debian 12 containers. Instead of the JVM crashing it exits due to insufficient memory being available. Still have to figure out why that is.
What do you see when you use the image to print the Java version?
docker run --rm openhab/openhab:4.0.0.M4 java -version
++ echo java -version
+ '[' 'java -version' == 'gosu openhab tini -s ./start.sh' ']'
+ exec java -version
[0.025s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EPERM) for attributes: stacksize: 1024k, guardsize: 4k, detached.
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create worker GC thread. Out of system resources.
# An error report file with more information is saved as:
# /openhab/hs_err_pid1.log