I tempted to switch between a normal installation and Docker, both on 2.4.0. But first tries exposed some issues and handicaps a docker installation has in terms of network and exec binding.
Between switching the two modes, I detected an issue with org.apache.felix.fileinstall.
The interesting is, I had the issue moving to a Docker installation and then reverting it. Moving to the Docker setup I mapped existing directories to the container, ensuring all my config, widgets a.s.o are kept.
So, now I move back and get the following error message:
2019-11-12 20:56:55.054 [WARN ] [org.apache.felix.fileinstall ] - /openhab/addons does not exist, please create it.
2019-11-12 20:56:55.064 [ERROR] [org.apache.felix.fileinstall ] - Cannot create folder /openhab/userdata/tmp/bundles. Is the folder write-protected?
2019-11-12 20:56:55.065 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedServiceFactory, id=37, bundle=10/mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.4]: Unexpected problem updating configuration org.apache.felix.fileinstall.c1e1a3cc-6144-4592-abe3-345300402702
java.lang.RuntimeException: Cannot create folder: /openhab/userdata/tmp/bundles
This refers actually to the Docker file locations, and it looks to be cached somewhere.
I cleared already the /var/lib/openhab2/userdata/tmp and /var/lib/openhab2/userdata/cache folders. But this does not change anything.
Permissions to folders a.s.o are checked and correct.
So, where can I find the setting for this and clear it?
The Docker container uses a manual type install. $OH_CONF is located in /openhab/conf instead of /etc/openhab2 and $OH_USERDATA is located in /openhab/userdata instead of /var/lib/openhab2.
Please show what arguments you are passing to docker run, in particular your volume mappings. The errors seem to indicate that the openhab user (by default uid 9001 IIRC) does not have permission to write to the volume you mapped in to /openhab/userdata.
Of course. openHAB only sees the the file system inside of the container. It doesn’t have a /var/lib/openhab2 folder.
The container’s settings are correct. I think OP is confused about where things are located and how volumes get mounted into containers.
Well, actually that is what I did, reverting Docker back to native OS finally.
I returned to native OS for some other reasons.
Anyway, I’m back now on native OS. Where is the $OH_USERDATA variable set in native OS?
The org.apache.felix.fileinstall still assumes that I try to run a Docker system.
The permissions were all correct. The org.apache.felix.fileinstall was just always looking at the wrong place. Since I did not find any hint to tweak this behavior back to normal, I decided to do the following:
save all user config data, e.g. icons, rules, etc.
De-install openHAB including purging all related data using apt-get purge openhab2*
Re-install openHAB incl. the corrections may reqiered for items, thinks, etc.
That actually fixed this issue.
Other articles are already mentioning that moving directories under openHAB is not easy, especially the org.apache.felix.fileinstall.