Startup failure because of "Unexpected end of input at 1:1"

Suddenly my OpenHAB 2 instance stopped working. Looking at the openhab.log it looks as if it is hung in an endless startup loop:

2017-05-21 22:49:33.429 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Haus.items'
2017-05-21 22:49:33.887 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rrd4j.persist'
2017-05-21 22:49:36.835 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rolladen.rules'
2017-05-21 22:49:39.354 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Haus.sitemap'
2017-05-21 22:49:39.953 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Haus.things'
2017-05-21 22:49:40.256 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:d710305695244ddc95829a2170dba193' to inbox.
2017-05-21 22:49:40.264 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:1f4e20c420a1219c9c4c21ad79a24754' to inbox.
2017-05-21 22:49:40.269 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:1d26fd6d1476d081e2e430c320908be5' to inbox.
2017-05-21 22:49:42.309 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at /start
2017-05-21 22:49:44.642 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-05-21 22:49:45.463 [INFO ] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app
2017-05-21 22:49:45.802 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-05-21 22:49:59.565 [WARN ] [raf.features.internal.osgi.Activator] - Error starting activator
java.io.IOException: Unexpected end of input at 1:1
        at org.apache.karaf.features.internal.util.JsonReader.error(JsonReader.java:337)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.util.JsonReader.expected(JsonReader.java:331)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.util.JsonReader.readValue(JsonReader.java:93)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.util.JsonReader.parse(JsonReader.java:58)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.util.JsonReader.read(JsonReader.java:52)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.region.DigraphHelper.readDigraph(DigraphHelper.java:112)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.region.DigraphHelper.loadDigraph(DigraphHelper.java:70)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:130)[8:org.apache.karaf.features.core:4.0.8]
        at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:246)[8:org.apache.karaf.features.core:4.0.8]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_65]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]

My installation is OpenHAB2 running on Raspbian:
ii openhab2 2.0.0-1 all openhab2
ii openhab2-addons 2.1.0~20170218174525-1 all openhab2-addons

Try restoring the most recent JSON DB file in /var/lib/openhab2/jsondb. I’m guessing that something became corrupted in your JSONDB based on the error.

I ran the following commands:

cp 1495314468025–org.eclipse.smarthome.core.thing.Thing.json …/org.eclipse.smarthome.core.thing.Thing.json
cp 1495400964517–org.eclipse.smarthome.config.discovery.DiscoveryResult.json …/org.eclipse.smarthome.config.discovery.DiscoveryResult.json
cp 1492899694284–org.eclipse.smarthome.core.items.Item.json …/org.eclipse.smarthome.core.items.Item.json
cp 1492899694286–org.eclipse.smarthome.core.thing.link.ItemThingLink.json …/org.eclipse.smarthome.core.thing.link.ItemThingLink.json
cp 1492899694282–org.eclipse.smarthome.core.thing.link.ItemChannelLink.json …/org.eclipse.smarthome.core.thing.link.ItemChannelLink.json

When I started OpenHAB2 I got the same error.
I checked all files with json_pp and I received no errors, so I assume that they are valid JSON files.

Then I moved all the files from jsondb to a sub-folder “tmp” and when I restarted I got the same error.

Not sure whether the files from JSONDB are having an issue, maybe other JSON files are causing the issue.

Unfortunately, it seems the JSON DB files are not the source of your problem and I have no idea what the source may be.

OK, looking at the source code that is mentioned in the stacktrace:

org.apache.karaf.features.internal.region.DigraphHelper.loadDigraph(DigraphHelper.java:70)

OpenHAB2 is trying to read a file called “digraph.json”.
The file can be found here:

/var/lib/openhab2/cache/org.eclipse.osgi/8/data/digraph.json

Unfortunately it is empty, adding a minimal JSON structure “{}” just led to a NullpointerException instead.
It seems as if the cache folder got corrupted by a sudden power outage :frowning:

I renamed the cache folder to cache2 to see whether the cache gets build up again, but unfortunately it is not. I get a lot of exceptions now regarding some additional modules I installed manually.

Stop openhab, remove cache and tmp, then restart. Any addons you installed though PaperUI will need to reinstalled.

I assume it is cleaning the folder content, not removing the folders:

Jun 18 13:49:53 openhab2 start.sh[23054]: java.lang.RuntimeException: Exception instantiating lock class org.apache.karaf.main.lock.SimpleFileLock
Jun 18 13:49:53 openhab2 start.sh[23054]: Could not create file lock: Invalid karaf.lock.dir system property '/var/lib/openhab2/tmp' : does not exist
Jun 18 13:49:53 openhab2 start.sh[23054]: at org.apache.karaf.main.Main.createLock(Main.java:443)
Jun 18 13:49:53 openhab2 start.sh[23054]: at org.apache.karaf.main.Main.doMonitor(Main.java:371)
Jun 18 13:49:53 openhab2 start.sh[23054]: at org.apache.karaf.main.Main.access$100(Main.java:72)
Jun 18 13:49:53 openhab2 start.sh[23054]: at org.apache.karaf.main.Main$2.run(Main.java:362)
Jun 18 13:49:53 openhab2 start.sh[23054]: Caused by: java.lang.reflect.InvocationTargetException
Jun 18 13:49:53 openhab2 start.sh[23054]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Jun 18 13:49:53 openhab2 start.sh[23054]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
Jun 18 13:49:53 openhab2 start.sh[23054]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
Jun 18 13:49:53 openhab2 start.sh[23054]: at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
Jun 18 13:49:53 openhab2 start.sh[23054]: at org.apache.karaf.main.Main.createLock(Main.java:439)
Jun 18 13:49:53 openhab2 start.sh[23054]: ... 3 more

The cache folder gets created, the tmp folder not by starting openhab2.

Then manually recreate the tmp folder. Not sure if there is an issue on this or not but OH should create tmp if it doesn’t exist.

I am a newbie. How to remove cache and tmp?
Thanks

From the command line type the following:

openhab-cli stop

openhab-cli clean-cache

openhab-cli start

This will clean both cache and tmp.

Thanks @H102. That was quick, Will give a try.

Openhab is not starting at all now.

Below is the log.

2018-11-23 00:47:39.876 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:47:48.924 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:47:52.754 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:48:01.674 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:48:10.707 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:48:19.680 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:48:28.588 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:48:37.300 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:48:46.023 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

2018-11-23 00:48:54.779 [SEVERE] [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.(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: 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.(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.(Storage.java:132)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:68)
… 4 more

What issue were you having before cleaning cache and tmp?

I reinstalled the Openhab and how its working fine.
Thanks

did you issue openhab-cli clean-cache as root or another user?

I have seen this before (Permission denied) and I would like to identify the root-cause

I manually deleted cache and tmp from /var/lib/openhab2/. Because even after using openhab-cli clean-cache openhab wasn’t starting.
Hope it helps

I am not a java exception expert but the error is due to file missing at /var/lib/openhab2/cache and tmp like .fileTableLock and others.

the error is due to file system permissions problem. The OH2 process is trying to re-create the files but it can’t write into the subdirs.

the subdirs userdata/tmp and userdata/cache are re-populated with many files and other sub-directories by the OH2 process on startup if they are empty.

Normally, they should exist, but even if you removed the subdirs themselves, OH2 will re-create them (this is true for OH2.3+). openhab-cli clean-cache removes the subdirs and lets OH2 recreate them and re-populate them.

Since OH2 process runs as the openhab user, the permissions on these 2 subdirs should allow this user to write also into them. Somehow (this is what I am trying to understand) the subdirs were recreated using the wrong permissions. Did you perform mkdir using root after your removed them?

Yes, I used mkdir to make the folders. I didnt made the subdir though. I thought OH2 will make itself.
Since I didnt got success and I just started using OH, I thought of reinstalling it.

using root?

if yes: OH2 could not write into those subdirs because it’s running as the openhab user

you could have chown -R openhab:openhab /var/lib/openhab2/ and you would have been fine