Docker installation on Debian, using previous config directory

Hello,

I have finished most of the test I wanted to do with Home assistant and am quite happy with it, it is simple, stable, passes the WAF with no hickups, in a word, perfect !

All the test I was doing was on a test server running ubuntu 16.04 and I wanted to transition to my production server (under debian 9, stretch).

I was new to docker (and came to like it!) and thought the principle was that going from test to production was easy : one just had to copy the permanent config folder and he is good to go.

I was apparently wrong. I copied my config server through scp

My config folder looks like that :

HomeServer:/opt/Docker$ ls
Deconz  docker-compose.yml  docker-compose.yml.back  Home_Assistant  Node_Red

I then installed docker and docker-compose successfully

$ docker --version
Docker version 19.03.7, build 7141c199a2
$ docker-compose --version
docker-compose version 1.25.4, build 8d51620a

$ docker-compose up -d
Creating network "docker_default" with the default driver
Creating deconz         ... done
Creating home-assistant ... done
Creating node-red       ... done

I can now access node-red and deconz through ports 1880 and 8080 respectively but home assistant is not responding in my webbrowser. I I look at the docker logs

2020-03-10 17:05:39 WARNING (MainThread) [homeassistant.config_entries] Config entry for deconz not ready yet. Retrying in 80 seconds.
2020-03-10 17:07:05 ERROR (MainThread) [homeassistant.components.deconz] Error connecting to deCONZ gateway at 172.25.0.2
2020-03-10 17:07:05 WARNING (MainThread) [homeassistant.config_entries] Config entry for deconz not ready yet. Retrying in 80 seconds.
2020-03-10 17:07:10 ERROR (MainThread) [homeassistant.components.deconz] Error connecting to deCONZ gateway at 172.24.0.2
2020-03-10 17:07:10 WARNING (MainThread) [homeassistant.config_entries] Config entry for deconz not ready yet. Retrying in 80 seconds.

My docker-compose file was woking before it is :

version: '3'
services:
  homeassistant:
    container_name: home-assistant
    image: homeassistant/home-assistant:stable
    volumes:
      - /opt/Docker/Home_Assistant/:/config
    devices:
      - /dev/ttyZWAVE:/dev/ttyZWAVE	
    environment:
      - TZ=Europe/Paris
    restart: always
    network_mode: host
    ports:
      - "8123:8123"
  nodered:
    container_name: node-red
    restart: unless-stopped
    image: nodered/node-red:latest
    depends_on:
      - "homeassistant"
    user: root
    volumes:
      - /opt/Docker/Node_Red/:/data
    ports:
      - "1880:1880"
  deconz:
    image: marthoc/deconz
    container_name: deconz
    restart: always
    ports:
      - "8080:8080"
      - "5900:5900"
    volumes:
      - /opt/Docker/Deconz:/root/.local/share/dresden-elektronik/deCONZ
    devices:
      - /dev/ttyZIGBEE
    environment:
      - DECONZ_WEB_PORT=8080
      - DECONZ_WS_PORT=4443
      - DEBUG_INFO=1
      - DEBUG_APS=0
      - DEBUG_ZCL=0
      - DEBUG_ZDP=0
      - DEBUG_OTAU=0
      - DECONZ_DEVICE=/dev/ttyZIGBEE

I initially had a problem with docker that I solved, not sure if it related :

docker-compose up 
Creating network "docker_default" with the default driver
ERROR: Failed to program FILTER chain: iptables failed: iptables --wait -I FORWARD -o br-9f9ecc04497f -j DOCKER: iptables v1.6.0: Couldn't load target `DOCKER':No such file or directory

The solution was to restart docker service

if anybody has an idea, I am looking forward to hearing it !
Cheers

Discovery has issues with NAT which docker uses by default if you don’t specify network=host. You might fix it by setting network_mode host on your deconz container so it is on the same network as HA. If you are relying on discovery.

Alternatively if deconz let’s you manually specify a host versus relying on discovery, you might be able to set the host address in your config manually instead of network=host.

I think the iptables error is probably just because you don’t have firewall running. Docker attempts to update your firewall entries automatically when you use the ports option, if it isn’t running you will see an error. But it’s not usually an issue. Firewall will also interfere with discovery type stuff.

Thank you for answering.
I added

network_mode: host

at the end on the deconz config part of the docker-compose file but I still have the same problem
If I understood corecly the next step is to try

network_mode: 172.24.0.2

as per the logs ?

I meant put the host IP (not container IP) into your hass config for deconz if deconz allows for that. 172.24.x.x looks like a container IP range.

EDIT: Sorry looking at the docs I don’t see that as possible. Don’t know why people create things that can’t be manually configured.

For the network_mode: host I assume you restarted the container, etc. If you are still seeing that container IP in your logs it may be cached somewhere in hass, might have to delete the configuration and reconfigure it, it should be your Host IP if you set network_mode:host.

Yes I restarted the container of course. but I guess you are write is is casshed from the time HA autodetected and configured deconz

So frustrating if I have to delete all configuration !