Error while installing

  • Platform information:
    • Hardware: Docker @ RaspberryPi 4 (through OpenMediaVault OMV Extras)
    • OS: Debian
    • Java Runtime Environment: whatever java is on official docker image

What’s the problem

I’m trying to setup OpenHAB using Docker on RPi4. I did have running installation of OpenHAB 2.4 before (also with docker) on another machine.

I’m getting this error message in logs periodically:

15:28:58.982 [ERROR] [.core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-ui-homebuilder, openhab-ui-basic, openhab-ui-habpanel, openhab-ui-paper': Error:
        Error downloading mvn:org.openhab.ui.bundles/org.openhab.ui.paper/[2.5.0,2.6)

What I tried

  • starting with data from my previous installation
  • starting with my previous data but with cleared cache and tmp
  • starting empty OpenHAB image with different versions (2.4, 2.5.4, 2.5.4-debian, 2.5.4-alpine, latest).
  • setting log:set DEBUG core.karaf.internal

I always end up seeing this message, which doesn’t even say what the real problem was… There is no stack trace or causing exception. Only this message.

This may be RPi or situation specific - I tried this whole setup with docker and whatnot before with OpenMediaVault (debian) installed on VM and it worked ok. I’d just like to hear some tips on how to debug this error.

Welcome!

Does the Pi have a good Internet connection?
Please use the Debian Docker image. I have found issues sometimes with the Alpine ones.

Hi!
Well, the Pi is connected through ethernet cable to my home network which is 100 MBit/s. I didn’t notice any network related issues yet.

As for the image - I tried different ones. Right now I’m trying latest-debian and error is still the same.

// EDIT:

  • clarification: the internet connection is 100 MBit/s, not the local network :slight_smile:

Can you ping www.google.com for instance?
How are you running the Docker image, docker-compose or `docker run’?

If using docker-compose what is the contents of your docker-compose.yml file?
If using docker run what are your command line arguments?

pi@nas:~ $ ping google.com
PING google.com (172.217.16.46) 56(84) bytes of data.
64 bytes from muc03s08-in-f46.1e100.net (172.217.16.46): icmp_seq=1 ttl=57 time=15.4 ms
64 bytes from muc03s08-in-f46.1e100.net (172.217.16.46): icmp_seq=2 ttl=57 time=15.6 ms
64 bytes from muc03s08-in-f46.1e100.net (172.217.16.46): icmp_seq=3 ttl=57 time=16.2 ms
64 bytes from muc03s08-in-f46.1e100.net (172.217.16.46): icmp_seq=4 ttl=57 time=14.8 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 8ms
rtt min/avg/max/mdev = 14.812/15.501/16.156/0.496 ms

I use docker compose:

version: '2'
services:
  mqtt:
    container_name: mqtt
    image: eclipse-mosquitto
    volumes: 
      - /srv/dev-disk-by-label-AData/OpenHAB/mosquitto.conf:/mosquitto/config/mosquitto.conf
    restart: always
    network_mode: host

  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt:latest-dev
    volumes: 
        - /srv/dev-disk-by-label-AData/OpenHAB/zigbee2mqtt:/app/data
    devices:
        - /dev/ttyACM0:/dev/ttyACM0
    restart: always
    network_mode: host
    environment:
        - TZ=Europe/Warsaw
    depends_on:
        - mqtt

  influxdb:
    container_name: influxdb
    image: influxdb:latest
    network_mode: host
    restart: always
    volumes:
      - ./influxdb:/var/lib/influxdb
      - ./influxdb/init:/docker-entrypoint-initdb.d
    environment:
      - INFLUXDB_DB=openhab
      - INFLUXDB_READ_USER=grafana
      - INFLUXDB_READ_USER_PASSWORD=grafana
      - INFLUXDB_WRITE_USER=openhab
      - INFLUXDB_WRITE_USER_PASSWORD=openhab

  grafana:
    container_name: grafana
    image: grafana/grafana
    network_mode: host
    restart: always
    user: "1000"
    volumes:
      - /srv/dev-disk-by-label-AData/OpenHAB/grafana:/var/lib/grafana
    environment:
      - USER_ID=1000
      - GROUP_ID=1000
      - GF_PATHS_DATA=/var/lib/grafana/data
      - GF_PATHS_CONFIG=/var/lib/grafana/grafana.ini
        #- GF_PATHS_HOME=/var/lib/grafana/home
      - GF_PATHS_LOGS=/var/lib/grafana/logs
      - GF_PATHS_PLUGINS=/var/lib/grafana/plugins
    depends_on:
      - influxdb

  openhab:
    container_name: openhab
    image: openhab/openhab:latest-debian
    environment:
      - USER_ID=1000
      - GROUP_ID=100
      - OPENHAB_HTTP_PORT=8080
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - /srv/dev-disk-by-label-AData/OpenHAB/openhab/conf:/openhab/conf
      - /srv/dev-disk-by-label-AData/OpenHAB/openhab/userdata:/openhab/userdata
      - /srv/dev-disk-by-label-AData/OpenHAB/openhab/addons:/openhab/addons
    restart: always
    network_mode: host
    depends_on:
      - mqtt
      - influxdb

After waiting awhile to make sure OH has a chance to come online. If the error persists, try stopping OH and clearing the cache (delete the contents of userdata/cache and userdata/tmp. Restart and tell us whether the problem persists.

I already did that. OH was running for like a whole night. Problem persists.

Is user ID 1000 in group 1000 & 100 or is that a typo?

When UID and GID are not set up correctly OpenHAB refuse to even start.

pi@nas:/srv/dev-disk-by-label-AData/OpenHAB/openhab $ ls -nl
total 24
drwxr-sr-x+  2 1000 100 4096 May 17 16:05 addons
drwxr-xr-x+ 13 1000 100 4096 Apr 19 15:08 conf
drwxr-xr-x+  8 1000 100 4096 May 17 15:12 userdata
pi@nas:/srv/dev-disk-by-label-AData/OpenHAB/openhab $ grep pi /etc/passwd
pi:x:1000:1000:,,,:/home/pi:/bin/bash
pi@nas:/srv/dev-disk-by-label-AData/OpenHAB/openhab $ grep users /etc/group
users:x:100:pi

Gentelmen, I appreciate the time you put in looking into those configs and your guesses and I experimented with various settings for like a week now. I think that what I need now is a solid debug path that would lead me to the root cause of the problem, not just experimenting further.

I don’t understand why I don’t see the full stack trace containing the root cause for failure. I think I need that to solve the issue. Do you know how to set up more verbose logging?

// EDIT:
Oh, I’ve looked into the code and this is very disappointing. The exception is swallowed and only the message is logged :frowning: Why it’s done like that?

1 Like

In the Docker-compose confid you posted the OpenHAB container has the same uid as another but a different gid. That is why I asked if there was a typo in the config.

Are the owner, group, and permissions set correctly on the mounted volumes? (UID 1000 GID 100)

Maybe you need to update some OMV component that has a bug, see:

1 Like

Yeah, I also suspected permissions to be the problem but this is not the case which you can actually see from my cmdline output - 3rd column is the owner UID (1000) and 4th is the GID (100). I have also set this recursively to subfolders and files.

1 Like

Just because it is missing try adding OPENHAB_HTTPS_PORT: "8443" I doubt it will help but it is in all examples I see.
Also network_mode: host is not listed in their example docker-compose file. I know it works in my testing without it.

My OMV Extras is version 5.3.3 and they claim to have fixed it in 5.3.1. This also is not the problem I’m seeing. Docker starts ok and is pulling all the images. I’ve successfully started few other containers (all in this docker-compose file) and they are running as expected.

I’ll give this a try, but it would be surprising if this worked :slight_smile:
Keep in mind that this exact docker-compose.yaml file was running flawlessly on another machine.

This is my Docker Setup:

and this is my docker-compose.yml

version: "2.2"

services:
  openhab:
    image: "openhab/openhab:2.5.0"
    container_name: openhab
    restart: always
    network_mode: host
    volumes:
      # If you are on Windows delete the /etc/localtime and /etc/timezone lines
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "${PWD}/openhab_addons:/openhab/addons"
      - "${PWD}/openhab_conf:/openhab/conf"
      - "${PWD}/openhab_userdata:/openhab/userdata"
    environment:
      OPENHAB_HTTP_PORT: "8080"
      OPENHAB_HTTPS_PORT: "8443"
      USER_ID: ${UID}
      GROUP_ID: ${GID}
      EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"
    ports:
      - "8080:8080"
      - "8443:8443"
  influxdb:
    image: influxdb:latest
    container_name: influxdb
    restart: always
    network_mode: host
    ports:
      - "8083:8083"
      - "8086:8086"
      - "8090:8090"
      - "25826:25826/udp"
      - "2003:2003"
    env_file:
      # Check the file to set default password!
      - "${PWD}/env.influxdb"
    volumes:
      - "${PWD}/influxdb/data:/var/lib/influxdb/"
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    restart: always
    network_mode: host
    user: "${UID}:${GID}"
    ports:
      - "3000:3000"
    env_file:
      - "${PWD}/env.grafana"
    volumes:
      - "${PWD}/grafana/data:/var/lib/grafana/"
  nodered:
    # If you are running on RaspBerryPi change the image to
    # nodered/node-red-docker:rpi
    image: nodered/node-red-docker:latest
    container_name: nodered
    restart: always
    network_mode: host
    user: root
    ports:
      - "1880:1880"
    volumes:
      - ./nodered:/data
  mosquitto:
    image: eclipse-mosquitto:latest
    container_name: mosquitto
    restart: always
    network_mode: host
    ports:
      - "1883:1883"
      - "9001:9001"

    volumes:
      - "${PWD}/mosquitto/conf:/mosquitto/config/"
      - "${PWD}/mosquitto/data/:/mosquitto/data/"
      - "${PWD}/mosquitto/log/:/mosquitto/log/"

Maybe there is something useful there :slight_smile:

@Bruce_Osborne as I suspected - this didn’t change anything.

@BrutalBirdie thanks, for sharing but I don’t think its a configuration issue. Also - why do you have network_mode: host and also ports: section? host basically means that you expose all the ports, so why bother listing the ports?

EDIT:
I’m starting to think that the only way to debug this is by forking the OpenHAB, fixing the code I linked in my previous post so it properly logs the whole exception and building the docker image from Dockerfile myself. Do you guys have other ideas?

Explicit is better then implicit :slight_smile:

I know it does no difference but since I created this repo for new users, writing down the Ports can help users figure out how this setup works.
Yes they could read the docs or lookup netstat -tulpen or something like that but why not in the config file :man_shrugging:

I agree on the explicit/implicit case. I’d probably remove the network_mode: host then since it does no good, and potentially may expose some unwanted ports implicitly :slight_smile:

1 Like

Problem with that is openHAB needs network_mode: host otherwise the container can not communicate with for example Phillips HUE.

I think there was a good topic about the whole docker network_mode difference and pros and cons.