Openhab not working with zulu11.0.20

  • Platform information:
    • Hardware: vmware
    • OS: Ubuntu 20.04
    • Java Runtime Environment: zulu11.0.20
    • openHAB version: 3.4.4
  • Issue of the topic: openhab cannot start after upgrading to zulu11.0.20

After upgrading to zulu11.0.20, openhab.log shows strange errors:

08:05:39.551 [ERROR] [Events.Framework                    ] - FrameworkEvent ERROR
java.util.zip.ZipException: Exception in opening zip file: /var/lib/openhab/cache/org.eclipse.osgi/18/0/bundleFile
Caused by: java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra data field size)
...
08:12:18.615 [SCHWERWIEGEND] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.RuntimeException: Error installing bundle listed in startup.properties with url: mvn:org.apache.karaf.features/org.apache.karaf.features.core/4.3.7 and startlevel: 15
Caused by: org.osgi.framework.BundleException: Error occurred installing a bundle.
Caused by: java.util.zip.ZipException: Exception in opening zip file: /var/lib/openhab/cache/org.eclipse.osgi/18/0/bundleFile
Caused by: java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra data field size)

After restarting service (with cleaning cache), openhab service is running but not working (not even a log file is written).

Maybe you ran out of free disk space so downloaded files end up corrupt (i.e. invalid zip files) and there is no space to write log files?

There is enough space.
Same problem occurred on a second installation.

Are you downloading .deb 64 bit version?
install: sudo dpkg -i zulu11-pakagename.deb
and sometimes that fails then run:
apt install -f
Then it works as far as I can remember from past experience.

I used apt upgrade without further flags.

Uninstall it and try again?

I just observed the same issue here on amd64 Debian 11 (bullseye) with Java from zulu repository.
Upgrading zulu11 from 11.0.19-1 to 11.0.20-1 broke my setup and throws errors like

2023-07-21 14:55:10.438 [ERROR] [Events.Framework                    ] - FrameworkEvent ERROR
java.util.zip.ZipException: Exception in opening zip file: /var/lib/openhab/cache/org.eclipse.osgi/18/0/bundleFile
[...]
Caused by: java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra data field size)

I did a downgrade of zulu11 using

apt install `dpkg -l zulu\* | grep ^i | awk '{print $2}' | sed 's/$/=11.0.19-1/'`

and after this downgrade OpenHAB 3.4.4 starts up without problems again.

Searching for “Invalid CEN header” brought me via Builds broken - July 19, 2023 · Issue #3174 · iBotPeaches/Apktool · GitHub to Consolidated JDK 11 Release Notes which mentions:

core-libs/java.util.jar
âžś Improved ZIP64 Extra Field Validation (JDK-8302483 (not public))
java.util.zip.ZipFile has been updated to provide additional validation of ZIP64 extra fields when opening a ZIP file. This validation may be disabled by setting the system property jdk.util.zip.disableZip64ExtraFieldValidation to true.

So it may be necessary to set the mentioned system property with java 11.0.20.
I did this by setting

EXTRA_JAVA_OPTS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true"

in /etc/default/openhab and after this openhab starts working with java 11.0.20 as expected.

2 Likes

I reported this as an issue against openhab-core:

Can you please type list -s -t 0 and let us know what bundle 18 (first column) is?

I did the Zulu update a few days ago and run in the same issue.
Then I downgraded java and OpenHAB was running fine again.
Tried the workaround above and updated Zulu to 11.0.20, now the ERRORs are gone.
I found a second stack trace which appears over and over again (bundle 59 → org.apache.aries.javax.jax.rs-api)

OS: CentOS Stream release 8 (4.18.0-500.el8.x86_64)
Java Runtime Environment: zulu11.0.20
openHAB version: 3.4.4

2023-07-23 11:52:14.575 [ERROR] [Events.Framework                    ] - FrameworkEvent ERROR
java.util.zip.ZipException: Exception in opening zip file: /var/lib/openhab/cache/org.eclipse.osgi/18/0/bundleFile
...
Caused by: java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra data field size)

2023-07-23 11:52:19.579 [ERROR] [Events.Framework                    ] - FrameworkEvent ERROR
java.util.zip.ZipException: Exception in opening zip file: /var/lib/openhab/cache/org.eclipse.osgi/59/0/.cp/lib/geronimo-osgi-locator.jar
...
Caused by: java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra data field size)
18 │ Active   │  15 │ 4.3.7                   │ org.apache.karaf.features.core
59 │ Active   │  80 │ 1.0.1                   │ org.apache.aries.javax.jax.rs-api
1 Like

I have the same error messages in the openhab.log. The addition of

EXTRA_JAVA_OPTS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true"

also solved the problem for me.

OS: 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

openHAB version: 3.4.4

java --version
openjdk 11.0.20 2023-07-18 LTS
OpenJDK Runtime Environment Zulu11.66+15-CA (build 11.0.20+8-LTS)
OpenJDK 64-Bit Server VM Zulu11.66+15-CA (build 11.0.20+8-LTS, mixed mode)

This woraround works for me too.

After that I’ve update to java 17 and openHAB starts without this workaround.

Thanks
Uls

Thank you for your investigations.
It works!

There’s an openHAB 3.4.5 release now in which the zip validation is disabled by default:

Thank you - this solved the problem instantly for me. Version 4.3.7 on Ubuntu 22, just did a systemwide software update then Openhab started throwing the ZIP64 error and not working. My installation is in /opt/openhab and I just added:

export EXTRA_JAVA_OPTS=“-Djdk.util.zip.disableZip64ExtraFieldValidation=true”

to the beginning of start.sh then everything started working again.