OH2 APT-Install not starting anymore on RPi

Hello
this seems to be a problem for a few people. Some had luck that creating /var/lib/openhab2/tmp was the solution as it was missing (not missing on my install).
My install does not work anymore. I am not 100% sure if right after an apt-get upgrade was done…

service openhab2 status shows the following

● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: active (running) since Thu 2017-01-12 18:40:54 CET; 4s ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 23293 ExecStop=/usr/share/openhab2/runtime/karaf/bin/stop (code=exited, status=203/EXEC)
 Main PID: 23297 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─23297 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           └─23446 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/open...

Jan 12 18:40:54 openhab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Jan 12 18:40:54 openhab2 systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 12 18:40:54 openhab2 start.sh[23297]: Launching the openHAB runtime...

/var/log/daemon.log shows the following

Jan 12 18:39:54 openhab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Jan 12 18:39:54 openhab2 systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 12 18:39:54 openhab2 start.sh[21337]: Launching the openHAB runtime...
Jan 12 18:39:59 openhab2 start.sh[21337]: Error initializing storage.
Jan 12 18:39:59 openhab2 systemd[1]: openhab2.service: main process exited, code=exited, status=255/n/a
Jan 12 18:39:59 openhab2 systemd[21497]: Failed at step EXEC spawning /usr/share/openhab2/runtime/karaf/bin/stop: No such file or directory
Jan 12 18:39:59 openhab2 systemd[1]: openhab2.service: control process exited, code=exited status=203
Jan 12 18:39:59 openhab2 systemd[1]: Unit openhab2.service entered failed state.
Jan 12 18:39:59 openhab2 systemd[1]: openhab2.service holdoff time over, scheduling restart.
Jan 12 18:39:59 openhab2 systemd[1]: Stopping openHAB 2 - empowering the smart home...

From my checks rights seem ok.

Checked ownership of

  • /var/lib/openhab2 /
  • /usr/share/openhab2/
  • /var/log/openhab2
  • /etc/openhab2

Everything owned by openhab:openhab

Any ideas what might be the issue?
As topic states it is an apt-based install on a RPi

Thanks for any support :slight_smile:

EDIT
/var/log/openhab.log states the following:

2017-01-12 18:46:36.069 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.RuntimeException: Error initializing storage.
	at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:77)
	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:253)
	at org.apache.karaf.main.Main.main(Main.java:177)
Caused by: java.io.EOFException
	at java.io.DataInputStream.readInt(DataInputStream.java:392)
	at org.eclipse.osgi.container.ModuleDatabase$Persistence.readMap(ModuleDatabase.java:1332)
	at org.eclipse.osgi.container.ModuleDatabase$Persistence.readGenericInfo(ModuleDatabase.java:1280)
	at org.eclipse.osgi.container.ModuleDatabase$Persistence.readModule(ModuleDatabase.java:1107)
	at org.eclipse.osgi.container.ModuleDatabase$Persistence.load(ModuleDatabase.java:1015)
	at org.eclipse.osgi.container.ModuleDatabase.load(ModuleDatabase.java:879)
	at org.eclipse.osgi.storage.Storage.<init>(Storage.java:147)
	at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:87)
	at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:75)
	... 4 more

Did you try a simple apt remove openhab2 followed by apt install openhab2? With this step you can rule out most possible causes.

Hello
I did not yet try that, as I would not learn to much from that “did you try turning it off and on again” approach.

Currently my OH2 is just a test-platform and non-productive. Therefore I would like to learn as much as possible to be able to troubleshoot best once my house is build :wink:

If you have any recommendations for further debugging I would appreciate that.

If not I could at least test my config-backup-and-restore process with this :slight_smile:
Best regards

I had the error where I had to create the tmp directory by hand. Your error seems to be something different.

As far as this error could be analyzed from far away anything had made any change to the system. :slight_smile: To get a better overview:

  • What was the last changes you did to the system?
  • Is openhab responsive via web?
  • Can you log into the karaf console?
  • Is the error reproduceable after restarting the PC?

That’s a thought I can totally relate to. However as we (I suspect) are talking about an unstable snapshot build, the problem could simply be related to some already fixed bug. Nothing big to learn here besides “Unstable, use at your own risk” :wink:

One thing you could test because of “Error initializing storage.”: Try deleting your jsondb.

I was having similar issues and ended up backing up all my conf files and my jasondb files, then did a remove, purge and reinstall. I then manually readded bindings and all my zwave devices. From there I could use the item link and items jasondb files (you need to replace your zwave id in the link file) and restore all my conf files to get back to a clean system.

Hello everyone,
sorry for the late reply…currently quite busy

@semperor

What was the last changes you did to the system? **dont know :stuck_out_tongue:** 
Is openhab responsive via web? **no as it is not starting up**
Can you log into the karaf console? **no as it is not starting up**
Is the error reproduceable after restarting the PC? **yes**

@ThomDietrich

Where do I find the jsondb?
I would like to test this approach and otherwise finish my backup script and give that a “live-testrun” with a apt-get remove/install

Where you would normally expect it, somewhere under userdata. :wink: I had to look myself, yes it’s at /var/lib/openhab2/jsondb/...

Hello
nothing there:

drwxr-xr-x 16 openhab openhab  4096 Jan 13 04:31 .
drwxr-xr-x 33 root    root     4096 Dec 18 20:05 ..
drwxr-xr-x  4 openhab openhab  4096 Dec 25 18:07 cache
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:05 deploy
drwxr-xr-x  2 openhab openhab  4096 Dec 26 18:30 etc
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:07 generated-bundles
-rw-r--r--  1 openhab openhab 28108 Jan 13 04:29 hs_err_pid1213.log
-rw-r--r--  1 openhab openhab 50957 Dec 18 20:08 hs_err_pid1224.log
-rw-r--r--  1 openhab openhab 49964 Dec 18 20:08 hs_err_pid1533.log
-rw-r--r--  1 openhab openhab 23895 Dec 28 06:36 hs_err_pid16633.log
-rw-r--r--  1 openhab openhab 82217 Dec 20 23:09 hs_err_pid17433.log
-rw-r--r--  1 openhab openhab 51941 Dec 18 20:09 hs_err_pid1875.log
-rw-r--r--  1 openhab openhab 51344 Dec 18 20:09 hs_err_pid2193.log
-rw-r--r--  1 openhab openhab 68818 Dec 20 23:10 hs_err_pid22641.log
-rw-r--r--  1 openhab openhab 58897 Dec 25 18:05 hs_err_pid23661.log
-rw-r--r--  1 openhab openhab 51981 Dec 25 18:06 hs_err_pid23972.log
-rw-r--r--  1 openhab openhab 36524 Dec 25 18:06 hs_err_pid24302.log
-rw-r--r--  1 openhab openhab 40031 Dec 25 18:06 hs_err_pid24587.log
-rw-r--r--  1 openhab openhab 37234 Dec 25 18:06 hs_err_pid24873.log
-rw-r--r--  1 openhab openhab 56085 Dec 18 20:10 hs_err_pid2506.log
-rw-r--r--  1 openhab openhab 53193 Dec 25 18:07 hs_err_pid25159.log
-rw-r--r--  1 openhab openhab 54874 Dec 25 18:07 hs_err_pid25524.log
-rw-r--r--  1 openhab openhab 38495 Dec 25 18:08 hs_err_pid25904.log
-rw-r--r--  1 openhab openhab 38048 Dec 25 18:08 hs_err_pid26214.log
-rw-r--r--  1 openhab openhab 59474 Dec 18 20:10 hs_err_pid2815.log
-rw-r--r--  1 openhab openhab 73302 Dec 18 20:11 hs_err_pid3146.log
-rw-r--r--  1 openhab openhab 26421 Jan 13 04:31 hs_err_pid5465.log
-rw-r--r--  1 openhab openhab 50458 Dec 18 20:07 hs_err_pid882.log
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:10 kar
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:29 .karaf
-rw-r--r--  1 openhab openhab     0 Dec 18 20:07 lock
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:07 log
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:11 mapdb
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:20 myopenhab
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:07 .oracle_jre_usage
drwxr-xr-x  5 openhab openhab  4096 Dec 18 20:05 persistence
-rw-r--r--  1 openhab openhab     5 Dec 25 18:08 port
drwxr-xr-x  2 openhab openhab  4096 Dec 18 20:24 security
drwxr-xr-x 29 openhab openhab  4096 Jan 12 18:21 tmp
-rw-r--r--  1 openhab openhab    36 Dec 18 20:20 uuid
drwxr-xr-x  3 openhab openhab  4096 Dec 20 21:51 webapps

You must be on a pretty old build… Replacement of mapdb by jsondb

apt-cache showpkg openhab2
Package: openhab2
Versions: 
2.0.0~RC1-1 (/var/lib/apt/lists/dl.bintray.com_openhab_apt-repo2_dists_testing_main_binary-armhf_Packages)
 Description Language: 
                 File: /var/lib/apt/lists/dl.bintray.com_openhab_apt-repo2_dists_testing_main_binary-armhf_Packages
                  MD5: 326ece3868ef747762229ee66dc0da02


Reverse Depends: 
  openhab2-addons-legacy,openhab2
  openhab2-addons,openhab2
Dependencies: 
2.0.0~RC1-1 - adduser (0 (null)) openhab2-online (0 (null)) openhab2-offline (0 (null)) 
Provides: 
2.0.0~RC1-1 - 
Reverse Provides: 

Thats the latest apt-get offers to me

cat /etc/apt/sources.list.d/openhab2.list 
deb http://dl.bintray.com/openhab/apt-repo2 testing main

Source wrong? Took that from the official documentation

No everythings fine… Maybe your system didn’t create one yet as you didn’t create any things or items via PaperUI?

That might be.
I only use the PaperUI for activating bindings. All item config is done “old school”

I will do a backup in a few minutes and reinstall. Will let you know of the results

1 Like

Hello
after reinstallation OH2 runs smoothly again. I will restore the backup of the config over the weekend and see if my backup script did its job good :wink:

Thanks for the help so far guys :slight_smile:

1 Like