Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] random missing network when service has more than one #11601

Closed
shencangsheng opened this issue Mar 12, 2024 · 4 comments
Closed

[BUG] random missing network when service has more than one #11601

shencangsheng opened this issue Mar 12, 2024 · 4 comments

Comments

@shencangsheng
Copy link

shencangsheng commented Mar 12, 2024

Description

I am encountering an issue while utilizing an external network, named some-network, in the docker-compose.yml file. I have defined this external network and applied it to a specific service. However, when I use the command docker compose up -d, there are intermittent occurrences where the service starts successfully without loading the specified external network. Upon inspecting the service using docker inspect, I noticed that the some-network entry is not present under the Networks section.

I have already upgraded the version of Docker Compose to above the version that fixes this problem, but this issue still occurs.

Steps To Reproduce

  1. docker network create some-network
version: "3.0"
services:
  nginx:
    image: nginx:latest
    environment:
      TZ: Asia/Shanghai
    restart: always
    networks:
      - some-network
      - nginx-network
networks:
  nginx-network:
  some-network:
    external: true
  1. docker compose up -d

Expected behavior

docker inspect nginx Networks appear some-network

Compose Version

Docker Compose version v2.24.6

Docker Environment

Client: Docker Engine - Community
 Version:    25.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.6
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 23
  Running: 23
  Paused: 0
  Stopped: 0
 Images: 18
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 3.10.0-1160.49.1.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 62.36GiB
 Name: Genecast_Workstation
 ID: 916dd817-6126-402c-8520-0a0d893f7b49
 Docker Root Dir: /data/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

moby/moby#46155

#10778

@f1amy
Copy link

f1amy commented Mar 15, 2024

Experiencing the same. Messes up my workflow very much.
Could not find any workaround.

@f1amy
Copy link

f1amy commented Mar 15, 2024

@shencangsheng maybe the same issue as #11563 (comment)?

@tralafiti
Copy link

Had the same bug and can confirm that this was fixed in #11510 included in v2.24.7. However, docker desktop still delivers the broken compose version v2.24.6

@ndeloof
Copy link
Contributor

ndeloof commented Apr 19, 2024

I'm closing this issue as Docker Desktop 4.29.0 comes with v2.26.1 which has the fix for this bug

@ndeloof ndeloof closed this as completed Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants