openhab / openhab-docker

Repository for building Docker containers for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
209 stars 128 forks source link

Setup failed with vfat volume #344

Closed barthel closed 3 years ago

barthel commented 3 years ago

I tried to install the openhab/openhab:latest-debian and openhab/openhab:latest with docker-compose on a Raspberry Pi 3B:

OS Information | linux armv7l Raspbian GNU/Linux 10 (buster)
Kernel Version | 4.19.118-v7+

The docker-compose.yaml looks like:

version: '2.2'

services:
  openhab:
    container_name: openhab
    image: "openhab/openhab:latest-debian"
    restart: always
    ports:
      - 8080:8080
      - 8443:8443
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - /data/openhab-data/conf:/openhab/conf
      - /data/openhab-data/userdata:/openhab/userdata
      - /data/openhab-data/addons:/openhab/addons
      - /data/openhab-data/cont-init.d:/etc/cont-init.d
    environment:
      OPENHAB_HTTP_PORT: "8080"
      OPENHAB_HTTPS_PORT: "8443"
      EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"
      # export USER_ID=$(id -u admin); export GROUP_ID=$(cut -d: -f3 < <(getent group docker)); docker-compose -f openhab_docker-compose.yml up -d
      # export USER_ID=$(id -u admin);
      USER_ID: "${USER_ID:?'Please run as follows: export USER_ID=$(id -u admin); export GROUP_ID=$(cut -d: -f3 < <(getent group docker)); docker-compose up -d'}"
      # export GROUP_ID=$(cut -d: -f3 < <(getent group docker));
      GROUP_ID: "${GROUP_ID:?'Please run as follows: export USER_ID=$(id -u admin); export GROUP_ID=$(cut -d: -f3 < <(getent group docker)); docker-compose up -d'}"

Most of the volumes are located on /data which is a mounted vfat USB device.

The startup failed with:

openhab    | ++ test -t 0
openhab    | ++ echo false
openhab    | + interactive=false
openhab    | + set -euo pipefail
openhab    | + IFS='
openhab    |    '
openhab    | + '[' limited = unlimited ']'
openhab    | + rm -f /openhab/runtime/instances/instance.properties
openhab    | + rm -f /openhab/userdata/tmp/instances/instance.properties
openhab    | Starting with openhab user id: 1000 and group id: 999
openhab    | + NEW_USER_ID=1000
openhab    | + NEW_GROUP_ID=999
openhab    | + echo 'Starting with openhab user id: 1000 and group id: 999'
openhab    | + id -u openhab
openhab    | + initialize_volume /openhab/conf /openhab/dist/conf
openhab    | + volume=/openhab/conf
openhab    | + source=/openhab/dist/conf
openhab    | ++ ls -A /openhab/conf
openhab    | + '[' -z '' ']'
openhab    | Initializing empty volume /openhab/conf ...
openhab    | + echo 'Initializing empty volume /openhab/conf ...'
openhab    | + cp -av /openhab/dist/conf/. /openhab/conf/
openhab    | '/openhab/dist/conf/./html' -> '/openhab/conf/./html'
openhab    | '/openhab/dist/conf/./html/index.html' -> '/openhab/conf/./html/index.html'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./html/index.html': Operation not permitted
openhab    | '/openhab/dist/conf/./html/readme.txt' -> '/openhab/conf/./html/readme.txt'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./html/readme.txt': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./html': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./icons/classic/readme.txt': Operation not permitted
openhab    | '/openhab/dist/conf/./icons' -> '/openhab/conf/./icons'
openhab    | '/openhab/dist/conf/./icons/classic' -> '/openhab/conf/./icons/classic'
openhab    | '/openhab/dist/conf/./icons/classic/readme.txt' -> '/openhab/conf/./icons/classic/readme.txt'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./icons/classic': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./icons': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./items/readme.txt': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./items': Operation not permitted
openhab    | '/openhab/dist/conf/./items' -> '/openhab/conf/./items'
openhab    | '/openhab/dist/conf/./items/readme.txt' -> '/openhab/conf/./items/readme.txt'
openhab    | '/openhab/dist/conf/./persistence' -> '/openhab/conf/./persistence'
openhab    | '/openhab/dist/conf/./persistence/readme.txt' -> '/openhab/conf/./persistence/readme.txt'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./persistence/readme.txt': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./persistence': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./rules/readme.txt': Operation not permitted
openhab    | '/openhab/dist/conf/./rules' -> '/openhab/conf/./rules'
openhab    | '/openhab/dist/conf/./rules/readme.txt' -> '/openhab/conf/./rules/readme.txt'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./rules': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./scripts/readme.txt': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./scripts''/openhab/dist/conf/./scripts' -> '/openhab/conf/./scripts'
openhab    | '/openhab/dist/conf/./scripts/readme.txt' -> '/openhab/conf/./scripts/readme.txt'
openhab    | : Operation not permitted
openhab    | '/openhab/dist/conf/./services' -> '/openhab/conf/./services'
openhab    | '/openhab/dist/conf/./services/addons.cfg' -> '/openhab/conf/./services/addons.cfg'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./services/addons.cfg': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./services/readme.txt': Operation not permitted
openhab    | '/openhab/dist/conf/./services/readme.txt' -> '/openhab/conf/./services/readme.txt'
openhab    | '/openhab/dist/conf/./services/runtime.cfg' -> '/openhab/conf/./services/runtime.cfg'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./services/runtime.cfg': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./services': Operation not permitted
openhab    | '/openhab/dist/conf/./sitemaps' -> '/openhab/conf/./sitemaps'
openhab    | '/openhab/dist/conf/./sitemaps/readme.txt' -> '/openhab/conf/./sitemaps/readme.txt'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./sitemaps/readme.txt': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./sitemaps': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./sounds/barking.mp3': Operation not permitted
openhab    | '/openhab/dist/conf/./sounds' -> '/openhab/conf/./sounds'
openhab    | '/openhab/dist/conf/./sounds/barking.mp3' -> '/openhab/conf/./sounds/barking.mp3'
openhab    | '/openhab/dist/conf/./sounds/doorbell.mp3' -> '/openhab/conf/./sounds/doorbell.mp3'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./sounds/doorbell.mp3': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./sounds': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./things/readme.txt': Operation not permitted
openhab    | '/openhab/dist/conf/./things' -> '/openhab/conf/./things'
openhab    | '/openhab/dist/conf/./things/readme.txt' -> '/openhab/conf/./things/readme.txt'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./things': Operation not permitted
openhab    | '/openhab/dist/conf/./transform' -> '/openhab/conf/./transform'
openhab    | '/openhab/dist/conf/./transform/de.map' -> '/openhab/conf/./transform/de.map'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./transform/de.map': Operation not permitted
openhab    | '/openhab/dist/conf/./transform/en.map' -> '/openhab/conf/./transform/en.map'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./transform/en.map': Operation not permitted
openhab    | '/openhab/dist/conf/./transform/readme.txt' -> '/openhab/conf/./transform/readme.txt'
openhab    | cp: failed to preserve ownership for '/openhab/conf/./transform/readme.txt': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/./transform': Operation not permitted
openhab    | cp: failed to preserve ownership for '/openhab/conf/.': Operation not permitted
openhab exited with code 1

That's may because of cp -av ... in: https://github.com/openhab/openhab-docker/blob/d17aaceba7ac5fe83098853aa273daddcaeada0e/alpine/entrypoint#L54 or https://github.com/openhab/openhab-docker/blob/d17aaceba7ac5fe83098853aa273daddcaeada0e/debian/entrypoint#L63

Is copying with the arguments -av really necessary? Is there anything else that speaks against a vfat mount point for volumes?

There is nothing in the documentation about to NOT use a vfat mount point.

wborn commented 3 years ago

You may be the first one actually trying vfat with the container. :wink: Does everything work properly if you change those commands?

wborn commented 3 years ago

Without any answers to questions, fixing this issue will be difficult.