New docker installation doesn't start

(Marc Forth) #1

Hi,

Just trying to give this a spin following the docker instructions, but when the docker container starts I get the following in the logs:

cmp: /openhab/userdata.dist/etc/version.properties: No such file or directory
+ '[' '!' -z ']'
++ ls -A /openhab/conf
+ '[' -z 'html
icons
items
persistence
rules
scripts
services
sitemaps
sounds
things
transform' ']'
+ '[' -d /etc/cont-init.d ']'
+ chown -R openhab:openhab /openhab
+ sync
+ '[' true == false ']'
+ exec gosu openhab tini -s ./start.sh
[FATAL tini (19)] exec ./start.sh failed: No such file or directory

Seems as though it is expecting me to already have a configuration, which obviously I don’t because it’s my first install - any ideas please?

Thanks in advance.

0 Likes

(Marc Forth) #2

A quick bump to see if anybody has any ideas at all?

0 Likes

(Scott Karns) #3

Without a lot more detail about your setup, the only help possible will be wild ass guesses. Please read:

On what OS are you hosting Docker? How are you starting your OH container? Copies of relevant files, like your startup script will be useful (don’t post them without code fences!). UIDs/GIDs on your host system? …

0 Likes

(Marc Forth) #4

I was kinda hoping the console output would have made sense to someone in the know, rather than people making ‘wild ass guesses’ tbh, but there we are.

Debian

I initially tried docker-compose, but when I couldn’t get that to work I just used docker run following the instructions on this page…

I don’t have any relevant files, this is the first run. There is no mention of having to create files on the page I followed, only the blank directories. I was given to understand that the first run would create the files, which I would later edit to facilitate my use, if this is not the case please tell me where I can find what files I need and I will update the page I linked to to include that information.

I initially used the uid and gid for the unprivileged user I already had on the system. Then I wondered if it didn’t work because there is some reason that the container expects a openhab dedicated user, so I literally just followed the instructions on that page to try and get it running, but every time the same error.

0 Likes

(Scott Karns) #5

I should have explicitly asked for directory/file ownership and permissions for your various openhab_* volumes specified in your docker startup script.

0 Likes

(Marc Forth) #6

As I say, initially these were set to be my already-existing unprivileged user. After this, they were set to the openhab user.

It appears that the docker container sets this anyway, as one of the lines in the output I get is the chown command.

0 Likes

(Scott Karns) #7

What about the command you entered to start your OH container? Also, did you do this to ensure your openhab* volumes exist before invoking docker run .....?

0 Likes

(Marc Forth) #8

Yes. I made the directories.

The command I used to start the container was as per the instructions on that page, with the uid / gid changed to match the uid / gid of the openhab user I have created (999/998 in this case)

0 Likes

(Scott Karns) #9

As an example of Docker container creation and startup, my bash startup script looks like this:

#!/bin/bash

if [ $# -lt 1 ]; then
  OH_TAG="2.5.0-snapshot-amd64-debian"
else
  OH_TAG="$1"
fi

ZIGBEE_TTY=`readlink -f /dev/ttyUSBzigbee`

docker run \
    --name openhab \
    --tty=true \
    --net=host \
    --device=${ZIGBEE_TTY} \
    -v /etc/localtime:/etc/localtime:ro \
    -v /home/openhab/oh/timezone:/etc/timezone:ro \
    -v /home/openhab/oh/openhab_addons:/openhab/addons \
    -v /home/openhab/oh/openhab_conf:/openhab/conf \
    -v /home/openhab/oh/openhab_userdata:/openhab/userdata \
    --env="EXTRA_JAVA_OPTS=-Duser.timezone=America/Denver -Dgnu.io.rxtx.SerialPorts=${ZIGBEE_TTY} -Xbootclasspath/a:/openhab/conf/automation/jython/jython-standalone-2.7.0.jar -Dpython.home=/openhab/conf/automation/jython -Dpython.path=/openhab/conf/automation/lib/python" \
    --env="OPENHAB_HTTP_PORT=8080" \
    --env="OPENHAB_HTTPS_PORT=8443" \
    --env="USER_ID=1000" \
    --env="GROUP_ID=1000" \
    -d \
    --restart=always \
    openhab/openhab:${OH_TAG}
0 Likes

(Marc Forth) #10

I was just running the command in the console, but yes the docker run command is pretty much identical, but without the ${OH_TAG} as I just let it pull the latest version.

As per the error message I’m receiving it appears that the docker container is expecting me to have files in the directories, and is not treating the empty directories as a cue to create a fresh install.

0 Likes

(Scott Karns) #11

It would still be useful to see your actual docker run command line, perhaps there is something there that you just don’t see because you’ve been poring over it for some time now? In my experience another, fresh set of eyes never hurts.

Also, what about ownership and permissions of your openhab* volumes? From my system:

[openhab@casabot ~]$ fgrep openhab /etc/passwd
openhab:x:1000:1000:OpenHAB User:/home/openhab:/bin/bash
[openhab@casabot ~]$ ls -ld /home/openhab/oh/{timezone,openhab_addons,openhab_conf,openhab_userdata}
drwxrwxr-x.  2 openhab openhab   6 Jan  8 12:44 /home/openhab/oh/openhab_addons
drwxr-xr-x. 15 openhab openhab 216 Feb 12 10:51 /home/openhab/oh/openhab_conf
drwxr-xr-x. 13 openhab openhab 179 Feb 12 10:36 /home/openhab/oh/openhab_userdata
-rw-rw-r--.  1 openhab openhab  15 Jan  8 13:11 /home/openhab/oh/timezone
0 Likes