compose: [BUG] Compose up often fails to join one random network on v2.24.6
Description
This may be closely related to #11510 but it seemed different enough to open another issue. Whenever I run docker-compose up -d and one or multiple containers in the compose has multiple networks, it often randomly fails to join exactly one network.
I have tried with internal, external and a mix of internal and external networks with anything between 3 and 10 networks and the result is always the same: About 60% of the time it fails to join exactly one network, the exact network is different. Tried on 2 different installations and both has the same result.
I see nothing relevant in the container logs, journalctl or docker event.
Reverting to 2.24.5 fixes this problem.
Steps To Reproduce
- Create docker-compose file with at least one container with multiple networks, for example:
version: "3.8"
networks:
test1:
test2:
test3:
services:
whoami:
image: traefik/whoami
container_name: whoami
networks:
- test1
- test2
- test3
- run docker-compose up
- run docker container inspect and count the networks
Doing the above 10 times, the container joined all 3 networks 4 times and then only 2 networks 6 times (the missing network seemed random, either test1, test2 or test3)
A quick way to test step 2 and 3:
docker stop whoami && docker rm whoami && docker compose up -d && docker container inspect -f '{{ len .NetworkSettings.Networks }}' whoami && docker container inspect -f '{{ range $key, $value := .NetworkSettings.Networks }}{{$key}} {{end}}' whoami
Compose Version
Docker Compose version 2.24.6
Docker Environment
Client:
Version: 25.0.2
Context: default
Debug Mode: false
Plugins:
compose: Docker Compose (Docker Inc.)
Version: 2.24.6
Path: /usr/lib/docker/cli-plugins/docker-compose
Server:
Containers: 54
Running: 4
Paused: 0
Stopped: 50
Images: 83
Server Version: 25.0.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: true
Native Overlay Diff: false
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
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: 7c3aca7a610df76212171d200ca3811ff6096eb8.m
runc version:
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.7.5-arch1-1
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.31GiB
Name: PC
ID: ZVFP:QROB:AMZD:7QXN:EBLS:QEAF:NVK2:NCJL:MJF5:GIXF:NQ4I:S5EH
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Anything else?
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 25
- Comments: 34 (5 by maintainers)
We just released Compose v2.24.7 which should resolve this. Thanks for your patience and the detailed reports!
A bit of clarity on
compose-goversioning that might be helpful: both projects (https://github.com/compose-spec/compose-go & https://github.com/docker/compose) are maintained by the same group of Docker Inc employees (with community contributions of course ❤️).These projects/repositories are split to enable other tools to use the compose-go library without needing to depend on the full Compose app (this repo), which has a substantially larger dependency tree.
API compatibility within Go modules is a challenging topic with very specific SemVer expectations from the Go tooling[^1]. Recently, we made some more substantial changes to the API: adding
context.Context, removing deprecated methods, correcting mistakes in types, etc.These types of breaking changes are easy for us to coordinate & handle as the maintainers of both packages, but we couldn’t practically version it as
v1.xwithout breaking other Go apps that import compose-go, so we made the decision to increment the package to v2.So, what you’re seeing with the “pre-release” tags on compose-go is an artifact of that. Once we tag a “stable” v2 release, that prevents us from practically making further changes to the library’s public API without another major release.
tl;dr The RC status is an indication that the
compose-golibrary/Go API might still change, which is important for managing Go dependency management.That said: regardless of version numbers, the stability & quality of Docker Compose is paramount, and we clearly had a miss here. We hugely appreciate the constructive & civil discussion on this issue; we’ve already covered some gaps in test coverage from these reports and identified additional areas, such as multi-network, where we need to improve E2E testing.
[^1]: I want to recognize that we have also not always adhered to this! The real world is messy and sometimes we make imperfect decisions to simplify maintenance.
@InTheNooB Compose
v2.26.1will be shipped in the next Docker Desktop release, if you’re really block you can download manually the binary for your platform from the release page and add the binary in your~/.docker/cli-pluginsdirectory as a workaroundSince today, the new v2.24.7 is in apt, at least for Ubuntu 20.04. The new version is working, I tested compose up/down five times, with 100% success rate.
Hello, can I ask about the status of rolling out v2.24.7 in official MacOS packages?
btw, I find strange that stable versions of compose are released that depend on release candidates of other software. This could be particularly dangerous in some cases. Is there a particular reason why it is done like this?
@Millio345 @mariaa144 we bumped the version of compose-go yesterday into the main branch of Compose with a fix about networks order & priority, can you check if the latest binary of Compose potentially fixes your issue?
Hello, any info about when v2.24.7 will be available via Docker Desktop for Windows ?
@rmlearney-digicatapult I managed to force an update of docker compose on mac with the following - had this is my history from the last time this issue occurred a few months back. Replace
aarch64withx86_64if you are on an intel macHello! 2.24.5 working fine.
I think it was version 2.19.1 that had the dns issue
I encountered this bug as well and I can confirm that the linked artifact of version c5a88de works again. I have restarted my service over 20 times and cannot reproduce the issue anymore.