[SOLVED] Could not launch framework OpenHAB 2.4

OpenHAB 2.4 is not starting anymore (Karaf)

After i cleard the cache (that’s the only action i can remember that has influence on this problem) I get error (see below)

2018-12-24 18:50:51.002 [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:70)
	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: java.io.FileNotFoundException: /var/lib/openhab2/cache/org.eclipse.osgi/.manager/.fileTableLock (Permission denied)
	at java.io.RandomAccessFile.open0(Native Method)
	at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
	at org.eclipse.osgi.internal.location.Locker_JavaNio.lock(Locker_JavaNio.java:36)
	at org.eclipse.osgi.storagemanager.StorageManager.lock(StorageManager.java:388)
	at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:701)
	at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:1776)
	at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:1793)
	at org.eclipse.osgi.storage.Storage.<init>(Storage.java:132)
	at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
	at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:68)
	... 4 more

I did: sudo chown -hR openhab:openhab /var/lib/openhab2/cache/org.eclipse.osgi/.manager/.fileTableLock

Now I get:

2018-12-24 18:53:30.337 [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:70)
	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: java.io.IOException: Permission denied
	at java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.io.File.createTempFile(File.java:2024)
	at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:187)
	at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:707)
	at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:1776)
	at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:1793)
	at org.eclipse.osgi.storage.Storage.<init>(Storage.java:132)
	at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
	at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:68)
	... 4 more

Any idee how to fix this?

5 Likes

If one file had bad permissions it is reasonable to assume you have many.

How did you install? The answer can determine how best to fix this. I think there is a fix permissions option on openhab and am even more sure there is a similar option on openhabian-conf.

Hi Rich

If remember correctly I installed OpenHAB 2.2 a long time ago whit APT

Upgraded to 2.3 and then to 2.4 with APT

OpenHAB itself was running fine, Only my Z-wave things where no longer recognised and some other “things” where off line See this post

I tried to solve it by cleaning the cache with openhab-cli clean-cache (this command I found in de forum)

Then after a reboot machine GUI was not accessible anymore.

I I’m now in de process of moving OpenHAB to a VM on my ESXI host.

But I like to fix this, even if only to learn from it.

OK, if you installed using apt then there is an option on openhab-cli to fix the permissions I believe.
I’ve no idea how the permissions got mangled in the first place.

You could fix it by hand with a command like

sudo chown -R openhab:openhab /var/lib/openhab2
1 Like

Hi Rich,
Thanks it works

sudo openhab-cli  reset-ownership
3 Likes

I had the same… and tried all the above. That appeared not enough. I finally could solve it by reinstalling Openhab2 using APT:

sudo apt-get install openhab2 --reinstall 
sudo apt-get install openhab2-addons --reinstall 

I do not use old addons, but you might also do:

sudo apt-get install openhab2-addons-legacy --reinstall 

And then, just in case:

sudo systemctl restart openhab2

Now it works again!

I want to say that i had this exact issue after doing a clear cache and thanfully this thread got me going again.

Thank you!

Exactly the same here (using 2.5.0 M6 and getting ready to go to stable).
Thanks all.

I have a similar issue, maybe the same. In the log it says:

2019-12-22 22:53:18.186 [SCHWERWIEGEND] [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:70)

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: java.io.IOException: Unable to create lock manager.

at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:698)

at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:1776)

at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:1793)

at org.eclipse.osgi.storage.Storage.<init>(Storage.java:132)

at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)

at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:68)

... 4 more

I tried to fix permissions with the config tool and also with the commands mentioned in this thread, like resetting the ownership. None of it solved the issue with the access to the GUI at openhabianpi:8080

The only thing I have not tried yet is

sudo apt-get install openhab2 --reinstall 
sudo apt-get install openhab2-addons --reinstall`

because I dont know whether this will just fix the issue or completely reinstall everything (so I will lose my items and rules, etc.). So if I do this, will I lose everything that is not backed up?
Sorry if this question sounds stupid, I am really not an expert in this.

After switching between the testing build and another snapshot the error seems to be gone and paper ui and habpanel etc. are accessible again and everything seems to load properly. I dont know what I did (except that I tried many commands from dozens of threads here in this forum) but in the end most of it has recovered.
It all started when I updated to 2.5. Lesson learned. :slight_smile:

Ditto here too, same issue after clearing cache and started with upgrading to 2.5 and the new email binding not working. Short version: clearing cache and then resetting permissions worked without needing a reinstall.

Luckily, … I had -just- added the Amanda backup procedures before rebooting, but none of the saved files were ultimately needed. Woohoo! :slight_smile:

The issue re-appeared two weeks ago suddenly (I haven’t updated/changed anything). I was about to give up but then I installed the latest stable version and restarted the service. Surprisingly everything was fine again.
I wouldn’t say this is solved forever as it appeared from time to time in the past. I wanted to setup everything again to have a clean installation but in another thread someone posted the same issue happened again after a fresh openhabian installation, so I won’t bother.

Yesterday it happened again, Suddenly. Haven’t changed or touched anything. Very annoying. But I was expecting that this will happen again.

[org.apache.karaf.main.Main] - Could not launch framework

java.lang.RuntimeException: Error initializing storage.

at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:70)

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: java.io.IOException: Unable to create lock manager.

at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:698)

at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:1776)

at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:1793)

at org.eclipse.osgi.storage.Storage.<init>(Storage.java:132)

at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)

at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:68)

... 4 more

After switching to the new unstable release, it works again. So I think I will stay with the unstable release to get some kind of stability in my openhab installation :slight_smile:

2020-04-25: Today it stopped again suddenly with the same error as above. I want to highlight that I did not update or change anything. It just stopped.
I will remove everything additional like grafana (because the stupid backup tool does not consider anything that is not openhab) and give it a last try. If the issue remains, it is time to give iobroker a chance. I spent a lot of time setting up the current configuration. I was very happy with openhab because it was doing what I wanted it to do. But issues like the one mentioned above that happened with just pressing the update button, make it hard to stick with this tool. I really love and appreciate the work the devs spent for this app but for me (and for several others, too, when I read the other threads) it does not seem to provide a solution that can run without continously fixing and maintaining things.

2 Likes