Openhab-cli clean-cache gets me "Could not launch framework"

Hi,
as the title says, after every openhab-cli clean-cache i get this:

2019-11-29 07:05:50.216 [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

it won’t stop.
i started with sudo /bin/systemctl start openhab2.service and stopped before cleaning cache.
Raspb. 3 / OH 2.4

After:

Fix Permissions
sudo systemctl stop openhab2
sudo openhab-cli clean-cache
sudo reboot

and several minutes of nothing in the log. it starts again with no Framework error

Are you using an SD card, USB, SSD? Have you checked the power supply is a good 5v 2.5A as the Pi needs this with OH.

i am using a SD Card, but will transfer it to an USB drive soon. The power supply is a original Raspb. supply, so as all other parts that came with it. ( it was a bundle )

If it was working, I would bet something got corrupt.

I would suggest reimage the sd card and restore a backup. I have had problems like this in the past.

You could try to reinstall java and openHAB, but if the card is corrupt there could be more files.

2 Likes

I agree with @Thedannymullen.:+1:

SSD with a case would be better than USB. SSD price is not bad ($25 US) for something around 120Gig. Picking a case that will work with the Pi is the only trick as others have mentioned some are not compatible/work.

Here is a link to what I have and it has worked great with Pi. [SOLVED] Issue restoring backup from RPI2 to RPI3 - #5 by H102

See the post below the one in the link above for a case that works well and only $8 US.

1 Like

the SD-Card is brand new. got it a few days ago, just for a new OH installation

This is the card that has the fresh install that’s giving the issues?

jep :frowning:

Ouch.:unamused:

Are you installing manually or using openhabian image? If openhabain image are you using Etcher to flash the card or something different?

openhabian.image -> etcher -> raspb. 3b

Thinking of buying a cheap intenso ssd

already have external ssd cases here.

My only suggestion is try to install Noobs lite on the card then pick raspbian OS. See if this will install and run on the Pi. If so we can then try to install OH from that point. If there are issues installing Noobs or raspbian then you may have a bad SD card.

1 Like

i bought the intenso ssd now. should i start fresh or would you just copy the files over from sd-card to ssd ?

I would start fresh and move over your backup file.

again, a fresh installtion of openhabian 1.5 (2.4.0.1)

after clean-cache:

2019-12-03 10:32:26.122 [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

2019-12-03 10:32:33.778 [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

Did you remember to stop openhab before you executed the clean-cache?

[05:54:44] openhabian@openhab:~$ sudo systemctl stop openhab2
[sudo] password for openhabian: 
[10:28:55] openhabian@openhab:~$ sudo openhab-cli clean-cache

This command will delete the temporary files within openHAB.
May resolve issues with addon installation and configuration.
The next start of openHAB will take a bit longer.

Okay to Continue? [y/N]: y
[10:29:22] openhabian@openhab:~$ sudo openhab-cli start

A systemd service configuration exists...
Use 'sudo /bin/systemctl start openhab2.service' to start an openHAB service
Launching an instance in this terminal..
Launching the openHAB runtime...

                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.4.0
                               Release Build

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

after

[10:43:17] openhabian@openhab:~$ sudo /bin/systemctl start openhab2.service
[10:43:37] openhabian@openhab:~$ sudo systemctl stop openhab2
[10:44:58] openhabian@openhab:~$ sudo openhab-cli clean-cache

This command will delete the temporary files within openHAB.
May resolve issues with addon installation and configuration.
The next start of openHAB will take a bit longer.

Okay to Continue? [y/N]: y
[10:45:24] openhabian@openhab:~$ sudo reboot
Connection to 192.168.1.100 closed by remote host.
Connection to 192.168.1.100 closed.

all is fine again…

my spotify binding (beta) is uninstalled after reboot and cleaning cache.
i think the issue is somewhere here