OH not starting after clean cache

Platform information:

  • Hardware: Rasp pi 4
  • OS: openhabian 3.0.1

Hi all
I wanted to clean the cache so I used the following thread:

I run the commands:

sudo /bin/systemctl stop openhab.service
sudo openhab-cli clean-cache
sudo /bin/systemctl start openhab.service

After that - the OH not start :frowning:
I rebooted and the OH not starting.
The output of

 sudo /bin/systemctl status openhab.service

is :

Warning: The unit file, source configuration file or drop-ins of openhab.service
● openhab.service - openHAB instance, reachable at http://openhab:8080
   Loaded: loaded (/lib/systemd/system/openhab.service; enabled; vendor preset:
  Drop-In: /etc/systemd/system/openhab.service.d
           └─override.conf
   Active: activating (auto-restart) (Result: exit-code) since Mon 2021-06-07 08
     Docs: https://www.openhab.org/docs/
           https://community.openhab.org
  Process: 10824 ExecStart=/usr/share/openhab/runtime/bin/karaf ${OPENHAB_STARTM
 Main PID: 10824 (code=exited, status=255/EXCEPTION)

Jun 07 08:51:59 openhab systemd[1]: openhab.service: Main process exited, code=e
Jun 07 08:51:59 openhab systemd[1]: openhab.service: Failed with result 'exit-co
lines 1-13/13 (END)

The only thing that starts the OH is the command:

 sudo openhab-cli start

Can someone tell me what I messed ?
Thank you!

1 Like

If you nonetheless plan to stay on an older openHAB release, please download the add-ons KAR

1 Like

In addition to what sihui brings up, there is only one time where clearing the cache is advisable or necessary: when there is a problem installing/uninstalling an add-on. All clearing the cache does is force openHAB to redownload and install all the add-ons.

But what add on do I need to get the service running again after restart?

That isn’t controlled by an add-on. But by clearing the cache you now have forced OH to reinstall all the addons.

And as the link sihui explains, the add-ons are not longer on Bintray. You need to upgrade to 3.0.2 or later so that OH will look for the add-ons in the right location.

Thanks for the response.
I will upgrade to 3.0.2.
But I didn’t manage to understand if it will fix the restart issue.

the command

sudo journalctl -u openhab

might do.

Hi
I run this command and got some exception - something with java files:
the output is

java.io.FileNotFoundException: /var/lib/openhab/cache/org.eclipse.osgi/.manager/.fileTableLock (Permission denied)
Jun 08 15:18:32 openhab karaf[23715]:         at java.base/java.io.RandomAccessFile.open0(Native Method)
Jun 08 15:18:32 openhab karaf[23715]:         at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:345)
Jun 08 15:18:32 openhab karaf[23715]:         at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259)
Jun 08 15:18:32 openhab karaf[23715]:         at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:214)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.internal.location.Locker_JavaNio.lock(Locker_JavaNio.java:36)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.storagemanager.StorageManager.lock(StorageManager.java:388)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:701)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:1776)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:1793)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.storage.Storage.<init>(Storage.java:132)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:68)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
Jun 08 15:18:32 openhab karaf[23715]:         at org.eclipse.osgi.launch.EquinoxFactory.newFramework(EquinoxFactory.java:24)
Jun 08 15:18:32 openhab karaf[23715]:         at org.apache.karaf.main.Main.launch(Main.java:256)
Jun 08 15:18:32 openhab karaf[23715]:         at org.apache.karaf.main.Main.main(Main.java:178)
Jun 08 15:18:32 openhab systemd[1]: openhab.service: Main process exited, code=exited, status=255/EXCEPTION
Jun 08 15:18:32 openhab systemd[1]: openhab.service: Failed with result 'exit-code'.
Jun 08 15:18:37 openhab systemd[1]: openhab.service: Service RestartSec=5s expired, scheduling restart.
Jun 08 15:18:37 openhab systemd[1]: openhab.service: Scheduled restart job, restart counter is at 15.
Jun 08 15:18:37 openhab systemd[1]: Stopped openHAB instance, reachable at http://openhab:8080.

Edit : Issue solved by the command:

sudo openhab-cli  reset-ownership

Thank you for the help!

1 Like