Docker Restarting: KARAF_ETC is not valid: /openhab/userdata/etc

Yes, but is that the uid/gid of the openhab-user you created? According to this post https://forum.openmediavault.org/index.php/Thread/13727-How-find-UID-and-GID-for-OMV-users/ you might have to install a plugin to run a shell to run the command I mentioned above :thinking:

I did have to assign that uid/gid under my old config, but since I reloaded this morning it’s correct on its own. uid

1 Like

So you are not using the official container from Docker Hub?

I’m a newb, my terminology is not correct. I use the docker hub image, but OMV has it’s own interface for taking that image and creating a container with it. See “run image” pick above.

I’m a newb, my terminology is not correct. I use the docker hub image, but OMV has it’s own interface for taking that image and creating a container with it. The OMV interface pre-populates with a lot of the environmental information required.

Here is somebody else with OMV who got things running.

Maybe I’m unreasonable, but when going through a set of instructions unless the steps are marked as optional I assume that they are mandatory. I don’t have to have each and every step labeled as mandatory. If there are none marked as optional, I assume that all steps are mandatory.

And in this case, the limitation isn’t one of openHAB, it’s a limitation of Docker. You cannot mount a folder that doesn’t exist on the host as a volume into a container. What you may be used to is Images where you only mount one folder as a volume into the container and the container creates the rest of the folders from that. That’s fairly common. But you cannot have a container that creates the root folder on the host on it’s own. It has to exist first!

It should be fine to copy in an existing config before the first run, but you have to copy your full config which means both conf and userdata. If you think that needs to be spelled out, there is a link at the bottom page where you can suggest edits to the instructions to make that more clear.

I run 13 containers from all different providers. There is no standard docker image behavior. Some make the folders, some do not. Some let you change the UID that it runs under, some do not.The OH image is pretty normal based on my experience. But anyone is more than welcome to improve the image if desired and able.

I don’t think you can call it a bug if it’s explicitly spelled out in the instructions. The root of the problem I think is assuming that the behaviors you have seen in other Docker images are standard and therefore making false assumptions about the instructions provided.

I suspect the developers will recategorize the issue as a feature request instead of a bug.

I just don’t get this. I mean, the OH docker image won’t make iced tea for you either. Do we need to document that? Is it a bug that it doesn’t do that?

That is definitely something worth filing an issue to correct. That I can see as a bug. But it’s also something that is pretty much understood by anyone with any experience using Docker. You can’t pass a non-existant folder on the host as a volume to the container.

Actually, ideally, the DockerHub instructions should be copied into the OH Official Docs. That was talked about at some point but I don’t know why it never happened.

OMV provides a nice GUI for running Docker containers on it. OMV is an FOSS NAS system so this is kind of akin to running on QNAP or Synology.

But as with all such UIs (cough cough PaperUI cough cough) it works great until something goes wrong or you actually need to understand how the stuff under the UI works. Then the user is lost.

2 Likes

The reason the manual is written is to give you a working system with the least effort.

The reason you try and evolve your setup is you believe you can improve it to better serve your uses. Research into learning how to do that without breaking things is part of that evolution process. If research steps are missed, who should get the blame?

So Rich, you are obviously far more experienced with Docker than I. I’m beating my head against the wall here. Months ago I was able to install OH in a Docker with no trouble, then… you can see I created the three folders, believe I gave them the appropriate permissions, created the user in OMV although I did notice that with OMV there is no /sbin/nologin but /usr/sbin/nologin. Also, you suggest creating a user with no shell. OMV does not provide that option. It provides a number of /bin/choices and /usr/sbin/nologin. Now I’ve changed things so much Im getting standard_init_linux.go:211: exec user process caused “exec format error”. This never ends.

I know Docker but I don’t know a fig about trying to run Docker containers on OMV (though I do use OMV).

But there are a ton of hints in my and fex and other’s posts above. The UID/GID of the openhab user that you created must either be 9001, or you need to pass in the actual UID/GID of the openhab user you created to the container as environment variables.

OMV is really not doing you any favors by providing that nice UI to create containers because you still have to understand how containers are started and how they work. You need to go learn you some Docker and build up your expertise enough that you can take the instructions and example docker -run commands in the docs and at DockerHuB and map each one of those arguments to that form that OMV presents. Or drop the OMV UI and do it all from the command line. Then you can just type them in.

1 Like

I agree 100% Rich, and I have made a subtle attempt to try, but without good guidance I am really apprehensive to mess something else up. Being new to Linux, I’m completely lost in all the different procedures and methods based on which Linux OS, which version, etc. It really seems almost impossible to see the light through the mud.
In regards to permissions, I think I have tried every possible combination that I can think of and still no result. I previously had Portainer up and running too. Setting Portainer up in a Docker is about as easy as it gets, yet for some reason since I reloaded OMV I keep having a “20:46:06 no such device” and cant get it running. I believe its a problem with the docker.sock file. No UID/GID to even consider with this one.
I find the inconsistencies very frustrating, and as you and Felix demonstrate, even the experts can’t provide a straight solution for the problem because there are so many potential variables to consider. Eventually I will do something I wont even know I did, everything will work, and I will have learned nothing.

Unfortunately we are not in a position where we can just say “do this.” Unfortunately it’s something you’re going to have to slog through. We are not sitting at your machine. We don’t know everything you’ve done. We don’t use the OMV UIs to try to get a docker container running. All we can do is tell you what we have here and give you the prerequisites for getting the container to run properly. If there is something else wrong (e.g. a permission problem on a Docker specific file) you’ll find better support on an OMV or Docker forum.

2 Likes

I understand completely, and appreciate both your help, and the help provided by others. I’ll figure this out, I eventually always do. When I do, I’ll be sure to post the solution here for others. Thanks.

1 Like

This error is still a sly bastard - see EDIT 2 at the end of my main post :grimacing:

I tried so many different solutions I have since forgotten exactly what the solution was, but I do remember that it wasn’t directly related to the userdata folder. I recall it was one of the other folders referenced, and what I did was edit the line in the docker to point to the correct location and it worked. I have since given up on the whole project and reverted back to my old install on the Pi. I started running into permissions problems, and the inability to use my existing items, things, rules, etc files so gave up. I’m going to mark this as solved. Thanks everyone for your help.

Hello all,
I’ve run into the same issue (KARAF_ETC is not valid: /openhab/userdata/etc) despite pre-creating the conf, addons & userdata directories. I also pre-created the username as openhab (uid and gid 2022) and passed these in the environment variables

environment:
    USER_ID: "2022"
    GROUP_ID: "2022"

I also ran chown -R openhab:openhab on the openhab directory so that conf, userdata and addons as well as the parent directory are owned by openhab:openhab.

What else am I missing?
It complained about missing version.properties in userdata/etc so I copied it from an existing installation and ended up with the second error.

I don’t know what I’m missing. Please help

I don’t know what I am missing either.
What operating system?

How are you starting the container? If you are using Docker run post your command. If you are using Docker-compose post the file for that.

We cannot help with no data.

@Bruce_Osborne. Thank you so much for your time. I’m using docker-compose and here is the relevant service part

  openhab:
    image: openhab/openhab:latest
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - $PWD/conf/openhab:/openhab/conf
      - $PWD/data/openhab/userdata:/openhab/userdata
      - $PWD/data/openhab/addons:/openhab/addons
      - $PWD/logs/openhab:/openhab/userdata/logs
    networks:
      - main
    environment:
        USER_ID: "2022"
        GROUP_ID: "2022"

Edit: The OS is Debian 10

Are you running the recommended Docker Community Edition or the default Debian packages?

Does UID 2022 have full write access to $PWD and its subdirectories? Can that user create directories there?

I’m using the version of docker installed by the script on the docker website.

Yes, user 2022 has full access to the directories. In fact, it creates folders etc under conf such as items, sites etc

drwxr-xr-x 2 openhab openhab 4096 Aug  3 20:16 addons
drwxr-xr-x 2 openhab openhab 4096 Aug  3 21:23 userdata