Docker install constantly restarts at "KARAF_ETC is not valid: /openhab/userdata/etc"

Hi, I previously had a perfectly good OH 2.4.0 running inside a Docker container. My Dockers (I have 11) run on an OpenMediaVault (OMV) server. I decided that I needed to upgrade my OH and completely went about it the wrong way, and a short time after my attempt, after rebooting OMV Docker apparently completed my previous upgrade attempt and everything went haywire.
I eventually decided to delete the OH image, the OH container, and all non persistent OH data from Docker and start over from scratch.
I have tried three different versions of OH (2.4.0, 2.5.0, & 2.5.1) all with exactly the same result. Each installation only installs part of OH, then goes into a constant cycle of container restarts, all at the same place in the installation script.
I end up with a basic “conf” folder directory structure except all the folders are not in the “conf” folder.
The container log shows the following final extract (I’m guessing no need to post the whole log):

  • ‘[’ -z ‘html
    transform’ ‘]’
    ++ cmp /openhab/userdata/etc/ /openhab/dist/userdata/etc/
    cmp: /openhab/userdata/etc/ No such file or directory
  • ‘[’ ‘!’ -z ‘]’
  • chown -R openhab:openhab /openhab
  • sync
  • ‘[’ -d /etc/cont-init.d ‘]’
  • sync
  • ‘[’ false == false ‘]’
    ++ IFS=’ ’
    ++ echo gosu openhab tini -s ./
  • ‘[’ ‘gosu openhab tini -s ./’ == ‘gosu openhab tini -s ./’ ‘]’
  • command=($@ server)
  • exec gosu openhab tini -s ./ server
    Launching the openHAB runtime…
    KARAF_ETC is not valid: /openhab/userdata/etc

I’m getting nowhere with this. Any suggestions?? Thanks

Yes, it’s a permission issue. It seems like the openHAB container has trouble to start for the first time if you have already folders (conf, addons, userdata).
I‘m not sure if the problem only exists on Pis or also on PC hardware (what are you using)?

Different steps I took to resolve that issue (still have to investigate which ones are necessary)

  • chown -R 9001:9001 openhab and setting UID & GID to standard user (1000) (9001 is the standard UID/GID for the image if you don’t set them)
  • chown -R 9001:9001 openhab-folder and setting UID & GID to 9001
  • chown -R 1000:1000 openhab and setting UID & GID to standard user (1000)
  • deleting the whole openhab-folder and let the container generate the folder
  • deleting only the contents of the subfolders conf, userdata & addons and letting the container generate the content…

If you get the container finally started without constant restarting you can copy your config into the folder without trouble…

I originally thought the same, but I have tried both my old UID/GID and the prefered 9001:9001. I’ve stripped out all of the sub folders and made a clean install as far back in the directory structure that I thought I needed to go. I’ve thought maybe it’s a corrupted Docker with “dirty” files still sitting in there somewhere. LOL, that didn’t sound to professional. I use a PC based system by the way with the Docker running inside OpenMediaVault; a nice program if anyone wants to set up a media server.

Permissions always screw me up. Let me clear this up, 9001:9001 are just place holders. If I id openhab:openhab I come up with 1004:995 so those are what I should be using??

Nope, 9001 is the default value if you don’t set the UID/GID values. It seems to me like the openHAB image is ignoring the configured values during the first startup and crashes…

I really am at wits end with this, sure hope I can get some guidance. My Docker install of openhab 2.5.1 continues to fail at:

Launching the openHAB runtime…
KARAF_ETC is not valid: /openhab/userdata/etc

It constantly restarts at that point. I have completely uninstalled my docker installation and lost of all of my Docker data (influx, grafana, pihole, etc) in an effort to find the solution to this. Extremely frustrating and spent hours and gotten nowhere.
I have created the openhab user and group per the docker instructions. I have deleted all of my openhab data down to the base folder for the docker install. I had openhab up and running for months before I screwed it up by trying to upgrade incorrectly. I dont feel that I can get any “fresher” an install unless I complete reformatted the host that the docker runs on. Fex mentioned permissions, and I suppose it still could be that although I don’t know how. Thanks in advance.

I think I found the solution: Docker Restarting: KARAF_ETC is not valid: /openhab/userdata/etc