2

I am running several docker containers and decided to reorganize them (split the configurations into folders gathering dependent services instead of having one big heap). Everything was going fine until I moved my Home Assistant configuration.

I did not change anything in the previous configuration, except enforcing a network common to all containers visible "externally" (outside of the private docker network). It works fine with the 20+ other containers.

  hass:
    devices:
      - /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0:/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
    image: homeassistant/home-assistant:2022.7
    network_mode: host
    restart: unless-stopped
    volumes:
      - /etc/docker/domotique/data/hass:/config
      - /etc/localtime:/etc/localtime:ro
    depends_on:
      - mqtt
    networks:
      - srv

(...)

networks:
  srv:
    external: true
    name: srv

When starting this container I get an error:

root@srv /e/d/domotique# docker-compose up hass
[+] Running 1/0
 ⠿ Container domotique-mqtt-1  Running                                                                             0.0s
Attaching to domotique-hass-1
Error response from daemon: failed to add interface veth6eb29e9 to sandbox: error setting interface "veth6eb29e9" IP to 172.18.0.33/16: cannot program address 172.18.0.33/16 in sandbox interface because it conflicts with existing route {Ifindex: 7 Dst: 172.18.0.0/16 Src: 172.18.0.1 Gw: <nil> Flags: [] Table: 254}

It disappears when I comment out network_mode: host. The running container has then the IP 172.18.0.33/16. Removing existing Home Assistant containers to force a recreation does not help.

What does this message mean in this context?

1 Answer 1

3

The problem is that I used network_mode: host and set at the same time the network to use (srv).

Removing the networks section solved the issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .