whats-up-docker icon indicating copy to clipboard operation
whats-up-docker copied to clipboard

Error when creating container grafana ((HTTP code 400) unexpected - Container cannot be connected to network endpoints: dlbox_private, backend_private ) (container=local_grafana)

Open r0m1CH opened this issue 2 years ago • 14 comments

Hello,

I encounter a new issue with automatic updates through my docker-compose file. I have a grafana container which needs to be updated. WUD sees the update, download it, stop my container and try to recreate the new one.

However it will never get back online. Here the log, I have: Error when creating container grafana ((HTTP code 400) unexpected - Container cannot be connected to network endpoints: dlbox_private, backend_private ) (container=local_grafana)

Anything am I doing wrong here or any configuration i'm missing ?

Thanks for your help.

r0m1CH avatar Oct 05 '22 16:10 r0m1CH

Anything ? i do see that docker does not accept to be connect to both network directly at the beginning. It seems that docker needs to connect the container to only one network at the start, then disconnect from it and finally connect, to both networks. Does that make sense for you ?

r0m1CH avatar Oct 09 '22 09:10 r0m1CH

Could this be anything to do with Grafana using the same port as What's Up Docker for it's webui? If so, maybe port mapping WUD to another port on the host (eg. 3333:3000) would fix it?

Teleportist avatar Oct 11 '22 14:10 Teleportist

I can try but the error seems to be specific to the multiple network instead no? I have this issue with all my container that use 2 or more networks. I find a similar case on Watchtower's project and seems to solved it the way i describe it into the second post: It seems that docker needs to connect the container to only one network at the start, then disconnect from it and finally connect, to both networks.

r0m1CH avatar Oct 11 '22 15:10 r0m1CH

Hi,

Can you provide your docker-compose file, please (so that I can make some tests on my end)?

fmartinou avatar Oct 15 '22 17:10 fmartinou

Hi,

Here you go : https://pastebin.com/5HAchU0T This is teslamate project. In this example, my PostgreSQL database is only available in an isolated backend network when the rest is on the LAN. Let me know if you need more info.

r0m1CH avatar Oct 16 '22 07:10 r0m1CH

Hi,

I have a same issue with all container using 2 networks : Error when creating container APPS_Uptime-Kuma ((HTTP code 400) unexpected - Container cannot be connected to network endpoints: APPS, TRAEFIK ) (container=local_APPS_Uptime-Kuma)

When I comment out the APPS or TRAEFIK network of my APPS_Uptime-Kuma container, I don't get an error.

My compose :

version: '3.9'

services:
  APPS_Uptime-Kuma:
    container_name: APPS_Uptime-Kuma
    image: louislam/uptime-kuma:1.20.1
    restart: unless-stopped
    ports:
      - 3001:3001
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro  # Pour que uptime-kuma puisse écouter les événements Docker
      - ./${SERVICE_UPTIME_KUMA}/data:/app/data
    environment:
      - TZ=${TZ}
    networks:
      - TRAEFIK
      - APPS
    labels:
      - wud.watch=true
      - wud.watch.digest=false
      - wud.tag.include=^\d+\.\d+\.\d+$$
  APPS_WUD:
    image: fmartinou/whats-up-docker:6.0.2
    container_name: APPS_WUD
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./docker-compose.yaml:/wud/docker-compose.yaml
    ports:
      - 3000:3000
    networks:
      - TRAEFIK
      - APPS
    restart: unless-stopped
    environment:
      - WUD_WATCHER_LOCAL_CRON=0 * * * *
      - WUD_WATCHER_LOCAL_WATCHBYDEFAULT=false
      - WUD_REGISTRY_HUB_LOGIN=login
      - WUD_REGISTRY_HUB_PASSWORD=password
      - WUD_TRIGGER_DOCKERCOMPOSE_APPS_MODE=batch
      - WUD_TRIGGER_DOCKERCOMPOSE_APPS_FILE=/wud/docker-compose.yaml
      - WUD_TRIGGER_DOCKERCOMPOSE_APPS_BACKUP=false
      - WUD_TRIGGER_DOCKERCOMPOSE_APPS_PRUNE=false
    labels:
    #### WUD ####
      - wud.watch=true
      - wud.watch.digest=false
      - wud.tag.include=^\d+\.\d+\.\d+$$
networks:
  TRAEFIK:
    external: true
  APPS:
    external: true

Zatow avatar Feb 16 '23 21:02 Zatow

Watchtower seems to have had the same issue a while ago: https://github.com/containrrr/watchtower/pull/40

Related: https://github.com/moby/moby/issues/29265

This is expected, when creating a container, you can only specify a single network. Subsequent networks can be attached after that (docker network attach, or the corresponding API call docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/connect-a-container-to-a-network)

strayer avatar Mar 02 '23 15:03 strayer

any news on this, still having this issue for all my containers that have multiple networks connected. when not fixed it will make this app unusable for a lot of people. that would be a shame because it is really a great app. thanks for creating it. I'm using the docker-compose trigger, why not use the original docker-compose up -d command? That will fix this issue when using the docker-compose trigger.

appiekap653 avatar Sep 24 '23 13:09 appiekap653

I have the same problem. All my containers use netvlans and docker internal networks for databases. Any workarounds to solve this problem?

SMHRambo avatar Nov 08 '23 13:11 SMHRambo

Could we please get a fix for this so I can start using this software again, it is still unusable at the moment.

appiekap653 avatar May 26 '24 11:05 appiekap653

Any news regarding this issue? will this get picked up or not?

appiekap653 avatar Jul 07 '24 09:07 appiekap653

@fmartinou would you please look at this issue? maybe integrate this package: dockerode-compose, instead of dockerode for the compose watcher? I believe there is support in that package for containers with multiple networks. only thing I don't know is if this will work for all the rest, since this package is a complete rewrite of compose I don't know if it works correct for the complete compose specification.

appiekap653 avatar Jul 11 '24 09:07 appiekap653