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

Named network is not created anymore #9630

Closed
davidspiess opened this issue Jul 7, 2022 · 11 comments · Fixed by #9640
Closed

Named network is not created anymore #9630

davidspiess opened this issue Jul 7, 2022 · 11 comments · Fixed by #9640
Assignees

Comments

@davidspiess
Copy link

After upgrading Docker Desktop from 4.9.1 to 4.10.1 docker compose up fails with

Error response from daemon: network hgv not found.
Before the upgrade the external network was created automatically if it was not found.

services:
  api:
    container_name: awesome-api
    build:
      context: ./api
    networks:
      - hgv
      - default

networks:
  hgv:
    name: hgv

Output of docker compose version:

Docker Compose version v2.6.1

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.2)
  compose: Docker Compose (Docker Inc., v2.6.1)
  extension: Manages Docker extensions (Docker Inc., v0.2.7)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 4
  Running: 2
  Paused: 0
  Stopped: 2
 Images: 13
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc version: v1.1.2-0-ga916309
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.4.72-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 24.85GiB
 Name: docker-desktop
 ID: NNVH:TNPI:DJPP:VF6X:WZYT:QAUC:DLB5:GSA7:OGHR:7FKN:3RK3:U6JV
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
@armenak-baburyan
Copy link

I can confirm.

docker compose -f docker-compose.yml -f docker-compose.dev.yml build --pull backend
docker compose -f docker-compose.yml -f docker-compose.dev.yml down --timeout=60
Warning: No resource found to remove for project "raccoon".
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --detach backend
[+] Running 1/3
 ⠿ Container raccoon-postgres-1  Starting                                                                                                                                                                                3.6s
 ⠿ Container raccoon-redis-1     Starting                                                                                                                                                                                3.6s
 ⠿ Container raccoon-backend-1   Created                                                                                                                                                                                 1.2s
Error response from daemon: network raccoon_default not found

After downgrading docker compose to version 2.6.0

docker compose -f docker-compose.yml -f docker-compose.dev.yml down --timeout=60
[+] Running 3/3
 ⠿ Container raccoon-backend-1   Removed                                                                                                                                                                                 0.2s
 ⠿ Container raccoon-postgres-1  Removed                                                                                                                                                                                 0.3s
 ⠿ Container raccoon-redis-1     Removed                                                                                                                                                                                 0.5s
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --detach backend
[+] Running 4/4
 ⠿ Network raccoon_default       Created                                                                                                                                                                                 0.2s
 ⠿ Container raccoon-postgres-1  Started                                                                                                                                                                                 3.1s
 ⠿ Container raccoon-redis-1     Started                                                                                                                                                                                 3.0s
 ⠿ Container raccoon-backend-1   Started

@thaJeztah
Copy link
Member

/cc @glours @ulyssessouza

@glours
Copy link
Contributor

glours commented Jul 8, 2022

Hello @davidspiess and @armenak-baburyan

I tried with the react-java-mysql sample of awesome-compose, and I wasn't able to reproduce, can you:

  • Test also with this example and let us know if you reproduce the issue
  • Give us more details about your compose file or at least compose file which may help to reproduce the problem
  • Give us more info about OS, if your using wsl2 or not (I saw that's the case at least for @davidspiess) ...

@davidspiess
Copy link
Author

davidspiess commented Jul 8, 2022

/cc @glours @ulyssessouza

The sample repository does not use the network name yaml property

@glours
Copy link
Contributor

glours commented Jul 8, 2022

@davidspiess right but you can add it easily, I did that to test your issue. Just replace the network section like that:

networks:
  react-spring:
    name: react-spring
  spring-mysql:
    name: spring-mysql

@ithieme71
Copy link

I am currently facing the exact same issue after updating Docker Desktop from 4.9.1 to 4.10.1. My environment is an Apple Mac Studio with an M1 Max and macOS Monterey.

I also tried your react-java-mysql sample and this issue did not show up right away. Only when I set the names of the two networks in a similar way to what I use in my environment, I was able to reproduce the problem. But even then, it doesn't always occur.

Here is a quick sample with which I could reproduce the issue more often.

services:
  memcached:
    image: memcached
    restart: always
    networks:
      - abc
      - abc-dev

networks:
  abc:
    name: abc
  abc-dev:
    name: abc-dev

It probably won't happen the first time. Sometimes I had to docker compose up -d and docker compose down a few times until it happened the first time. Once it happens, it happens again and again. Sometimes docker system prune helped to make it work again at least once.

In my environment it only happens when one network name is a substring of the second network name like in my sample. As soon as I change abc to abc1, for example, it does not happen at all.

@davidspiess
Copy link
Author

@glours i tried your example and my repository at home (WIN 10, WSL2) and it worked without problems.
It seems to be a problem within our work environment, since every coworker experienced the exact same problem.

Docker info from my home pc, which works correctly:
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.2)
  compose: Docker Compose (Docker Inc., v2.6.1)
  extension: Manages Docker extensions (Docker Inc., v0.2.7)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 10
  Running: 0
  Paused: 0
  Stopped: 10
 Images: 13
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc version: v1.1.2-0-ga916309
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.4.72-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 12.38GiB
 Name: docker-desktop
 ID: I54U:JH5P:B2Y7:WLJP:XAPM:XNPA:YIYB:Z6JA:4P2P:76WZ:E54W:OIBD
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support

@glours
Copy link
Contributor

glours commented Jul 8, 2022

@davidspiess would you have the chance to test it soon at work? Just to check if you can reproduce it with the awesome-compose example?

@glours
Copy link
Contributor

glours commented Jul 8, 2022

@ithieme71 thanks, I managed to reproduce with you example 🙏

@davidspiess
Copy link
Author

@glours unfortunately i am out of office and can test it earliest on monday 😢

@davidspiess
Copy link
Author

@glours i was also able to reproduce it at home with @ithieme71 help. The moment i changed the folder name to start with the network name, it breaks. In my case the folder has the name hgv-api and the network name hgv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants