OH3 error creating /var/lib/openhab2/tmp/bundles question

Hello All, I was receiving this error:

2021-04-10 09:37:29.796 [ERROR] [org.apache.felix.fileinstall        ] - Cannot create folder /var/lib/openhab2/tmp/bundles. Is the folder write-protected?
2021-04-10 09:37:29.798 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedServiceFactory, id=38, bundle=10/mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.4]: Unexpected problem updating configuration org.apache.felix.fileinstall.fc092e7a-5ff2-483a-908f-41330800a177
java.lang.RuntimeException: Cannot create folder: /var/lib/openhab2/tmp/bundles
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.prepareDir(DirectoryWatcher.java:647) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.prepareTempDir(DirectoryWatcher.java:627) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.<init>(DirectoryWatcher.java:179) ~[?:?]
        at org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:248) ~[?:?]
        at org.apache.felix.fileinstall.internal.FileInstall$ConfigAdminSupport$Tracker.updated(FileInstall.java:378) ~[?:?]
        at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.updated(ManagedServiceFactoryTracker.java:159) ~[bundleFile:?]
        at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:93) [bundleFile:?]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.provide(ConfigurationManager.java:1253) [bundleFile:?]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.run(ConfigurationManager.java:1197) [bundleFile:?]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) [bundleFile:?]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [bundleFile:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

I did get rid of the error by creating:
/var/lib/openhab2/tmp/bundles and /usr/share/openhab2/addons.

I am curious if anyone possibly knows what could be causing openhab to look for these directories? I am running OH3 and I restored my OH2 backup. Everything is working fine even with this error.
I was trying to figure this out before moving from my files setup to a gui based setup.

Thanks!

That sound like an OS permissions error for the user running OH.

I would extract the backup into a temporary folder and then search in the content of the extracted files if /openhab2/ is being used in them.

Either

or

because of the parent directory /var/lib/openhab2 is not available and directories are not created recursively.

OH 3 users opehab directories and not openhab2.

If you restored OH2 backup I would guess they still refer to openhab2 ?

Cheers
Mark

Thanks for all the answers! I do believe something in my backup is referring to openhab2. This is what I am trying to find.

I may have to just restore bindings and things manually one at a time. This will immediately point out the problem when it hits.

Hi Danny did you find the issue?

I have the same issue after setting up a fresh 3.3 installation (Openhabian) and restored 2.5 backup.

2022-12-17 11:00:24.845 [WARN ] [org.apache.felix.fileinstall        ] - /usr/share/openhab2/addons does not exist, please create it.
2022-12-17 11:00:24.876 [ERROR] [org.apache.felix.fileinstall        ] - Cannot create folder /var/lib/openhab2/tmp/bundles. Is the folder write-protected?

How can I fix this issue?

Backup of OH 2.5 is not compatible with backup of OH 3.3.
You need to do an upgrade from OH 2.5 to 3.3 and then do a backup.
Several files of your OH 2.5 backup contain a path to folder …/openhab2/…
This path does not exist in an OH 3.3 installation.
You could try to add a link that points from openhab2 to openhab but this will not solve all the incompatibilities between OH 2.5 and OH 3.3.

This is bad news :frowning:
I already changed a lot on my new 3.3 environment …
Really no chance to fix it ?

Short question:
I searched for the string “/usr/share/openhab2/addons” on my 3.3 installation and found this file:
/var/lib/openhab/config/org/apache/felix/fileinstall/7e10c35b-88e2-4bc8-a141-07439167f869.config

File content is:

felix.fileinstall.active.level="90"
felix.fileinstall.dir="/usr/share/openhab2/addons"
felix.fileinstall.filename="file:/var/lib/openhab2/etc/org.apache.felix.fileinstall-deploy.cfg"
felix.fileinstall.log.level="3"
felix.fileinstall.poll="10000"
felix.fileinstall.start.level="80"
felix.fileinstall.subdir.mode="skip"
felix.fileinstall.tmpdir="/var/lib/openhab2/tmp/bundles"
service.factoryPid="org.apache.felix.fileinstall"
service.pid="org.apache.felix.fileinstall.7e10c35b-88e2-4bc8-a141-07439167f869"

Can I edit this file and change it to the correct directories?

It is a text file so technically it is possible to edit the file. In case you would like to do it you should first shutdown the OH service.
It would be easier to create a link to and catch all of the files - I assume that there is more than just one file that points to the OH2 setup.
But as stated earlier there are more differences between OH2 and OH3. Continuing this way you will/may get an instable system.

Thanks!
I know that it’s a risk :slight_smile:

But I have a “more or less” stable system and I will see