Fresh Install - Karaf Framework will not launch

  • Platform information:
    • Hardware: 64bit CPU with 4G RAM and 1.4T disk
    • OS: Ubuntu 16.04
    • Java Runtime Environment: zulu 10
    • openHAB version: latest from apt repo
  • Issue of the topic: a fresh install is failing at the initial service start up
  • Please post configurations (if applicable): no modifications to repo

So I followed the guide https://docs.openhab.org/installation/linux.html to install OH from the apt repo. At the stage where the service is started for the first time the deamon does not start. the out put from systmctl is:

$ sudo systemctl status openhab2.service
   openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2018-04-04 12:11:11 BST; 2s ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 30812 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=3)
  Process: 30612 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=255)
 Main PID: 30612 (code=exited, status=255)

Apr 04 12:11:11 Lisbeth systemd[1]: openhab2.service: Unit entered failed state.
Apr 04 12:11:11 Lisbeth systemd[1]: openhab2.service: Failed with result 'exit-code'.

Looking in the openhab.log file shows the following message for each restart attempt:

2018-04-04 12:15:31.501 [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:308)
        at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:90)
        at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:66)
        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:179)
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.1.3",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.1.3",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.1.3",, org.apache.karaf.branding, sun.misc, org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.1.3, 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.1.3, org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.1.3, org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.1.3"
        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:628)
        at org.eclipse.osgi.storage.Storage.checkSystemBundle(Storage.java:260)
        ... 6 more

I have been through and checked file permissions and ownership and it is ‘openhab’ all the way and everything is read and writable as I would expect. I have a java version like:

$ java -version
openjdk version "10" 2018-03-20
OpenJDK Runtime Environment Zulu10.1+11 (build 10+46)
OpenJDK 64-Bit Server VM Zulu10.1+11 (build 10+46, mixed mode)

On trying to run the start_debug.sh script I get some weird error messages - which make me think that there are some missing env vars.

$ sudo -u openhab ./start_debug.sh
Launching the openHAB runtime...
mkdir: cannot create directory ‘/usr/share/openhab2/userdata/tmp’: No such file or directory
./runtime/bin/karaf: 199: [: Illegal number:
KARAF_BASE is not valid: /usr/share/openhab2/userdata

I have had a good old google search and cannot find any answers specific to this issue.

[Worthy of note: I also run a small LAMP stack on this same server]

Hi @izanbard,

The Karaf framework version openHAB uses (and therefore openHAB) is only compatible with Java 8, you’ll need to install Zulu-8 instead of 10.

See the prerequites page.

Hope that helps,
Ben

1 Like