compose: [BUG] cycle detected at path with anchors
Description
docker compose up -d returns:
cycle detected at path: x-common-keys-dns-network
This worked before 2.30.0
Steps To Reproduce
this is my docker-compose.yml:
# Common environment values
x-environment: &default-tz-puid-pgid
TZ: $TZ
PUID: $PUID
PGID: $PGID
x-common-keys-dns: &common-keys-dns
dns:
- 1.1.1.1
- 1.0.0.1
x-common-keys-dns-network: &common-keys-dns-network
<<: *common-keys-dns
networks:
- t2_proxy
...
services:
...
mariadb:
<<: *common-keys-dns-network
image: ghcr.io/linuxserver/mariadb
container_name: mariadb
environment:
<<: *default-tz-puid-pgid
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
healthcheck:
test: "/usr/bin/mysql --user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --execute \"SELECT 1;\""
# test: "/usr/local/mysql/bin/mysql --user=foo --password=foo --execute \"SHOW DATABASES;\""
interval: 10s
timeout: 1s
retries: 5
ports:
- '3306:3306'
volumes:
- '/mnt/data/mariadb:/var/lib/mysql:Z'
- '${HOME}/docker/mariadb:/config'
restart: unless-stopped
Compose Version
v2.30.0
Docker Environment
Client: Docker Engine - Community Version: 27.3.1 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.17.1 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.30.0 Path: /usr/local/lib/docker/cli-plugins/docker-compose
Server: Containers: 41 Running: 41 Paused: 0 Stopped: 0 Images: 65 Server Version: 27.3.1 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Using metacopy: false Native Overlay Diff: true 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: active NodeID: mzspegqexo7ka7bwccebn09on Is Manager: true ClusterID: 2qn2wroe2sinvydtudxjesbk7 Managers: 3 Nodes: 5 Default Address Pool: 10.0.0.0/8 SubnetSize: 24 Data Path Port: 4789 Orchestration: Task History Retention Limit: 5 Raft: Snapshot Interval: 10000 Number of Old Snapshots to Retain: 0 Heartbeat Tick: 1 Election Tick: 10 Dispatcher: Heartbeat Period: 5 seconds CA Configuration: Expiry Duration: 3 months Force Rotate: 0 Autolock Managers: false Root Rotation In Progress: false Node Address: 192.168.1.132 Manager Addresses: 192.168.1.103:2377 192.168.1.132:2377 192.168.1.140:2377 Runtimes: io.containerd.runc.v2 runc Default Runtime: runc Init Binary: docker-init containerd version: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c runc version: v1.1.14-0-g2c9f560 init version: de40ad0 Security Options: apparmor seccomp Profile: builtin cgroupns Kernel Version: 6.11.0-9-generic Operating System: Ubuntu 24.10 OSType: linux Architecture: x86_64 CPUs: 6 Total Memory: 30.69GiB Name: nuc ID: 5ddf237a-7f91-4942-8702-6ce95a3666d7 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 2 years ago
- Reactions: 11
- Comments: 25 (1 by maintainers)
Commits related to this issue
- Revert "feat(api/production): update arc runners versions" This reverts commit 352de0958f1a4b7e3bb45767ae67c85ef7f91d9d. Due to: https://github.com/docker/compose/issues/12247 — committed to CrisisCleanup/configs by BradenM 2 years ago
- build(deps): update docker/compose to v2.30.3 This MR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/compose](https://github.com/docker/compose) | minor | `v2.... — committed to tmeijn/dotfiles by deleted user 2 years ago
- Downgrade docker I need an older docker compose version as the current version from 24.11 lets me run into the 'cycle detected at path' error [1]. [1] See https://github.com/docker/compose/issues/12... — committed to schmir/nix by schmir 2 years ago
Hello, I’ve probably found an edge case. The issue reproduces on main branch with this config:
My guess it is because of the
.in the service nameCould you try this one? docker-compose.zip
p.s. generally keep in mind, that it’s not a good idea to use binary from an unknown person because I can inject anything to the code)
Thanks a lot for the quick fix! ❤
Edit: I can confirm that everything works fine now!
@douglas you can download the official release with the fix now
@idsulik, thanks for providing the binary. No worries; I usually avoid it except for cases like this one 😉
I just tested your binary, and I can confirm it solves the problem 👍
Thanks again for quickly fixing the issue! Really appreciated ❤
pushed fix https://github.com/compose-spec/compose-go/pull/709
@douglas could you please provide your yaml config? I’ll check it as well
I’m having a similar bug after updating docker desktop a few hours ago. It’s running under docker compose v2.30.0 too.
The funny part is I’m only unable to run services with yaml anchors and aliases specifically inside Devcontainers, while using docker-outside-of-docker. Project runs fine on the WSL2 docker host.
Outputs same message for any services using anchors and aliases in its definition.
@idsulik Cool thanks ! I will wait for the release then, good job =)
You can try to change the config file to make it referenceless or wait until the next release with the fix(@glours FYI)
I’m having the the same error on 2.30.2 using the following minimal compose file:
Output:
I’m happy to test further things if this helps 👍
The error happens again on 2.30.2
works well on 2.30.1
@idsulik using 2.30.1 and still having this
cycle detected at pathissue. Worked prior to 2.30.minimal compose
Thank you for the issue, the fix is ready https://github.com/compose-spec/compose-go/pull/704