OH 2.5.12 problems after debian upgrade from 11 -> 12

As title suggests. After Debian upgrade to 12, Openhab won’t start. Error message:

2023-08-13 21:11:33.490 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.IllegalStateException: Could not create a builder for the system bundle.
        at org.eclipse.osgi.storage.Storage.checkSystemBundle(Storage.java:287)
        at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:87)
        at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:68)
        at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
        at org.eclipse.osgi.launch.EquinoxFactory.newFramework(EquinoxFactory.java:24)
        at org.apache.karaf.main.Main.launch(Main.java:256)
        at org.apache.karaf.main.Main.main(Main.java:178)
Caused by: org.osgi.framework.BundleException: Invalid manifest header Export-Package: "org.osgi.dto;version="1.0",org.osgi.resource;version="1.0",org.osgi.resource.dto;version="1.0";uses:="org.osgi.dto",org.osgi.framework;version="1.8",org.osgi.framework.dto;version="1.8";uses:="org.osgi.dto",org.osgi.framework.hooks.bundle;version="1.1";uses:="org.osgi.framework",org.osgi.framework.hooks.resolver;version="1.0";uses:="org.osgi.framework.wiring",org.osgi.framework.hooks.service;version="1.1";uses:="org.osgi.framework",org.osgi.framework.hooks.weaving;version="1.1";uses:="org.osgi.framework.wiring",org.osgi.framework.launch;version="1.2";uses:="org.osgi.framework",org.osgi.framework.namespace;version="1.1";uses:="org.osgi.resource",org.osgi.framework.startlevel;version="1.0";uses:="org.osgi.framework",org.osgi.framework.startlevel.dto;version="1.0";uses:="org.osgi.dto",org.osgi.framework.wiring;version="1.2";uses:="org.osgi.framework,org.osgi.resource",org.osgi.framework.wiring.dto;version="1.2";uses:="org.osgi.dto,org.osgi.resource.dto",org.osgi.service.condpermadmin;version="1.1.1";uses:="org.osgi.framework,org.osgi.service.permissionadmin",org.osgi.service.packageadmin;version="1.2";uses:="org.osgi.framework",org.osgi.service.permissionadmin;version="1.2",org.osgi.service.resolver;version="1.0";uses:="org.osgi.resource",org.osgi.service.startlevel;version="1.1";uses:="org.osgi.framework",org.osgi.service.url;version="1.0",org.osgi.util.tracker;version="1.5.1";uses:="org.osgi.framework",org.apache.karaf.version;version="4.2.7",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.7",org.apache.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version="4.2.7",org.apache.karaf.info;version="4.2.7",, org.apache.karaf.branding, sun.misc, org.apache.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version=4.2.7, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.7, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.7, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.7"
        at org.eclipse.osgi.util.ManifestElement.parseHeader(ManifestElement.java:353)
        at org.eclipse.osgi.container.builders.OSGiManifestBuilderFactory.createBuilder(OSGiManifestBuilderFactory.java:85)
        at org.eclipse.osgi.storage.Storage.getBuilder(Storage.java:632)
        at org.eclipse.osgi.storage.Storage.checkSystemBundle(Storage.java:273)
        ... 6 more
  • Platform information:
    • Hardware: x86_64/Intel(R) Core™ i3-7100T CPU @ 3.40GHz/4GB RAM
    • OS: Debian 12.1
    • Java Runtime Environment: openjdk version “17.0.8” 2023-07-18
    • openHAB version: 2.5.12

Hope this info is sufficient. I know I’m still running old OH. Is it not compatible anymore?
Sorry if that is true and I overlooked it.

Thank you!

openHAB versions below 4.0 do not run at Java 17! You need to downgrade your Java version to 8!

Thanks for hint. Once I selected the old alternative java, openhab started working.

update-alternatives --config java

Is it recommended to upgrade first to OH3 and then to OH4?

Thank you and br,

Either way it’s going to be a lot of work. I’m not sure there is any benefit in upgrading to 3 first.

Reading all the documentation and posts as a complete newb I get very confused about what people mean by versions. Everyone seems to mean openhab2, but write openhab.
So, when you say “openHAB versions below 4.0”, do you mean openhab or openhab2?
Cause the first is version 4.1.1-1, while second is 2.5.12-1, which I understand is recommended as of now for new setup.
My Java version is OpenJDK Runtime Environment (build 17.0.9+9-Debian-1deb12u1), the only one available on official Debian stable 32bit (very old laptop to try out smart home control). And I get same error.

That’s just how some of these posts here refer to versions in the context of the discussion in previous messages. Versions are sometimes omitted (to be determined from the context) or simplified (like openhab4, usually meaning any 4.x.y version of OpenHAB).

The versioning of OH follows a simple pattern (that is very common in software development/releae):

  • the first digit is the major version number (whenever a big change/upgrade is implemented, this number gets incremented).
  • the second digit is the minor version number (reflecting smaller but still sometimes ‘breaking’ changes are implemented).
  • the third digit is a fix version number (use to release fixes to an already released x.y version).
  • I don’t remember a fourth digit being used like ‘x.y.z-q’ but I may have missed something there.

The current release version is OpenHAB 4.1.1 (and 4.2.0 is being developed and released frequently as an testing ‘snapshot’ version for dare devils the want the bleeding edge…).

If you are new at OpenHAB, the only logical course is to install version 4.1.1. And Java 17 is needed for that as stated before (OpenJDK should be fine).
Can you elaborate a bit on the details: What version of OpenHAB did you install and using which mechanism (APT, manual, …)?

What made you think OpenHAB 2.5.12-1 is the second version? It is a very old OpenHAB version that should not be used by new users.

1 Like
$ apt search openhab
Sorting... Done
Full Text Search... Done
openhab/stable 4.1.1-1 all
  openhab

openhab-addons/stable 4.1.1-1 all
  openhab-addons

openhab2/stable,now 2.5.12-1 all [installed]
  openhab2

openhab2-addons/stable,now 2.5.12-1 all [installed]
  openhab2-addons

openhab2-addons-legacy/stable 2.5.3-1 all
  openhab2-addons-legacy

Installed from repository, as the most common way :smiley:

$ sudo grep -rP '^deb.*openhab' /etc/apt/sources.list*
/etc/apt/sources.list.d/openhab.list:deb [signed-by=/usr/share/keyrings/openhab.gpg] https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main

Can you be specific and show the actual log entries?

On a side note: I sometimes see people having issues with RWX settings on OH’s userdata directory. Did you check that the OpenHAB user has the correct access?

2024-01-24 14:31:30.321 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.RuntimeException: Error occurred while checking the system module.
        at org.eclipse.osgi.storage.Storage.checkSystemBundle(Storage.java:311)
        at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:87)
        at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:68)
        at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
        at org.eclipse.osgi.launch.EquinoxFactory.newFramework(EquinoxFactory.java:24)
        at org.apache.karaf.main.Main.launch(Main.java:256)
        at org.apache.karaf.main.Main.main(Main.java:178)
Caused by: org.osgi.framework.BundleException: Invalid manifest header Export-Package: "org.osgi.dto;version="1.0",org.osgi.resource;version="1.0",org.osgi.resource.dto;version="1.0";uses:="org.osgi.dto",org.osgi.framework;version="1.8",org.osgi.framework.dto;version="1.8";uses:="org.osgi.dto",org.osgi.framework.hooks.bundle;version="1.1";uses:="org.osgi.framework",org.osgi.framework.hooks.resolver;version="1.0";uses:="org.osgi.framework.wiring",org.osgi.framework.hooks.service;version="1.1";uses:="org.osgi.framework",org.osgi.framework.hooks.weaving;version="1.1";uses:="org.osgi.framework.wiring",org.osgi.framework.launch;version="1.2";uses:="org.osgi.framework",org.osgi.framework.namespace;version="1.1";uses:="org.osgi.resource",org.osgi.framework.startlevel;version="1.0";uses:="org.osgi.framework",org.osgi.framework.startlevel.dto;version="1.0";uses:="org.osgi.dto",org.osgi.framework.wiring;version="1.2";uses:="org.osgi.framework,org.osgi.resource",org.osgi.framework.wiring.dto;version="1.2";uses:="org.osgi.dto,org.osgi.resource.dto",org.osgi.service.condpermadmin;version="1.1.1";uses:="org.osgi.framework,org.osgi.service.permissionadmin",org.osgi.service.packageadmin;version="1.2";uses:="org.osgi.framework",org.osgi.service.permissionadmin;version="1.2",org.osgi.service.resolver;version="1.0";uses:="org.osgi.resource",org.osgi.service.startlevel;version="1.1";uses:="org.osgi.framework",org.osgi.service.url;version="1.0",org.osgi.util.tracker;version="1.5.1";uses:="org.osgi.framework",org.apache.karaf.version;version="4.2.7",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.7",org.apache.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version="4.2.7",org.apache.karaf.info;version="4.2.7",, org.apache.karaf.branding, sun.misc, org.apache.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version=4.2.7, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.7, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.7, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.7"
        at org.eclipse.osgi.util.ManifestElement.parseHeader(ManifestElement.java:353)
        at org.eclipse.osgi.container.builders.OSGiManifestBuilderFactory.createBuilder(OSGiManifestBuilderFactory.java:85)
        at org.eclipse.osgi.storage.Storage.getBuilder(Storage.java:632)
        at org.eclipse.osgi.storage.Storage.checkSystemBundle(Storage.java:263)
        ... 6 more

OK, I see now, not exactly same, second line is different - Error occurred while checking the system module. No idea what “the system module” is :smiley: Is that Karaf, that is wrong?

I have tried by fixing the rights, did not help.

You could try disabling apparmor?
And does java -version show the expected info?

Also, can’t hurt to start over.

Makes me wonder… Perhaps uninstall both Java en OH and reinstall/reboot, just to be sure.

OH 2.5 does not run with Java 17.

No, it does not !

I didn’t write it would :slight_smile:

Sorry, understood it as a question, my bad :wink:

OK, still confused what “version” is meant when, got a vibe that this is old:

openhab2/stable,now 2.5.12-1 all [installed]

and this is current openhab:

openhab/stable 4.1.1-1 all

So I removed the openhab2 and installed just openhab. Now it works.

A brief history of openHAB:

1.x

The very first versions of openHAB. Config was all text file based, and all binding configuration was in a single config file. Docs were an incomplete wiki.

2.x

Almost a complete rewrite of OH with a whole new architecture which enabled a REST API, automatic discovery of devices (Things), and support for an administration UI (PaperUI). All the folders and packages were “openhab2” to distinguish between 1.x and 2.x, making it easier to run the two in parallel on the same machine since migration between 1.x and 2.x was a very manual and involved process (see Migration from OH 1.x to OH 2 Tutorial). Eclipse SmartHome (ESH) was established with openHAB being the reference implementation.

3.x

Dropped support for 1.x style openHAB add-ons, replaced the administration UI with something more complete (MainUI). Introduction of the semantic model. Removed ESH and became a stand alone project once more.

Returned to using “openhab” instead of “openhab2” as an in place migration was much easier.

4.x

More of just a continuation and of the improvements made in 3.x instead of a massive change like a rearchitecture or introduction of a brand new UI for administration. There are plenty of new features and changes though to justify a new version.

So what does “version” mean? It means which release of OH are you running. OH 2 is a little weird as it was released separately with a different set of folders, but otherwise it is not special. OH 2 came before OH 3 which came before OH 4.