compose: [BUG] Regression: array items[0,1] must be unique starting from 2.24.1
Description
As per the subject, starting from 2.24.1, I am encountering this issue when there are overrides.
Steps To Reproduce
Create 2 files:
- docker-compose.yaml
version: "3.8"
services:
test:
image: ubuntu:latest
command: sleep infinity
volumes:
- ./src:/src
- docker-compose.override.yaml
services:
test:
volumes:
- ./src:/src
WIth 2.23.3:
❯ dc version
Docker Compose version 2.23.3
❯ dc down -v
With 2.24.1:
❯ ./dc-2.24.1 version
Docker Compose version v2.24.1
❯ ./dc-2.24.1 down -v
validating /home/paolo/temp/dc-compose/docker-compose.override.yml: services.test.volumes array items[0,1] must be unique
Compose Version
Docker Compose version v2.24.1
Docker Environment
❯ docker info
Client:
Version: 24.0.7
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: 0.12.1
Path: /usr/lib/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: 2.23.3
Path: /usr/lib/docker/cli-plugins/docker-compose
Server:
Containers: 15
Running: 9
Paused: 0
Stopped: 6
Images: 141
Server Version: 24.0.7
Storage Driver: btrfs
Btrfs:
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 logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 71909c1814c544ac47ab91d2e8b84718e517bb99.m
runc version:
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.6.11-2-lts
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 24
Total Memory: 30.49GiB
Name: paolo-cto-arch-wood
ID: ZRJM:NTZC:JCYV:OSU3:VB2H:N2CW:ZCLD:PCGW:JGT5:B2BR:445A:GEHV
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: 15
- Comments: 59 (19 by maintainers)
Commits related to this issue
- resolve docker compose regression This commit resovles the issue described in: <https://github.com/docker/compose/issues/11371> — committed to nkcyber/cybersword by zsarge 3 years ago
- resolve docker compose regression This commit resovles the issue described in: <https://github.com/docker/compose/issues/11371> — committed to nkcyber/cybersword by zsarge 3 years ago
Even with
extra_hosts.Docker Desktop 4.27.2 luckily fixed the issues for us!
@matanmarciano yes
Hello everyone 👋
We need your help to verify that we managed most of the problems you faced with the
v2.24.xreleasesI created a PR with the current fixes of merge issues, can you try it and let us know if you still have problem we didn’t already solved? Unfortunately you’ll have to download all the binaries but choose the right one for your platform and add it to your
~/.docker/cli-plugins/directory with the namedocker-composeWe already know there is a problem with the
networks.config.subneta fix is in progress for this oneRight. The issue continues appearing with
linksandprofilesthough. Here is the repro:main.yml:
secondary.yml:
command:
Hello all,
This is just in case this scenario was not covered by PR 533. Here is a simple case where docker compose complains about the
environmentssetting (services.myservice.environment array items[0,1] must be unique):main.yml
secondary.yml:
command:
Edit: If that matters, I removed everything just to make the scenario simple. I need the second file to declare volumes to the service that are not always needed.
So, this is same thing?
validating /root/qfieldcloud/docker-compose.override.local.yml: services.app.environment array items[1,46] must be unique
I don’t mean to be a pain here, but I’m seeing similar on v2.25.0. Figured best to post on this thread versus a new issue as it seems related to my newb self?
“validating /home/docker/docker-compose.override.yml: services.scrutinyanalogj.devices array items[0,11] must be unique”
@glours I can confirm that
Docker Compose version d4fb179does indeed fix all issues we had with the tmpfs array. so far. Every other aspect of our docker compose overwrite setup seems to work again. Many many thanks for your precious and highly appreciated work 🙏@solarlodge and all the others having issue with
tmpfs, those binaries should fix your issueIn my case, it is
services.nginx.labels array items[2,7] must be uniqueand still happens with Docker Compose 2.24.2… Shouldn’t it be fixed with this version?@solarlodge we try to address those on https://github.com/compose-spec/compose-go/pull/548
Here the very same issue with
linksandtmpfs…@YtvwlD please open a new bug for this
Is this released? No milestone assigned…
@ihor-sviziev Yes they decided to focus on the security fixes for this release, a next patch release of Docker Desktop is planned for next week… Sorry for the delay, anyway you can add manually the binary of Compose
v2.24.5to your~/.docker/cli-pluginsdirectory with the namedocker-compose@matanmarciano no indeed, a release of https://github.com/docker/docker-ce-packaging is planned later this week
@glours it is still not released to: https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/
@glours I can confirm, the fixed version fixes this issue for me.
@ihor-sviziev yes because the signature of the binary for MacOs is done as part of the Docker Desktop release, you have to approve it manually in
System settings>Privacy & SecurityYou could use those binaries which use thev2.0.0-rc.3release ofcompose-go@glours is there any estimation where that fix will be released?
The issue with the
services.*.labelsarray seems to be gone. Theservices.*.tmpfs arraystill gives the error msgvalidating *override*.yml: services.*.tmpfs array items[0,3] must be unique. Tested withDocker Compose version 41161da.@glours, Thanks!
I confirm our full scenario works properly with the build you provided (
Docker Compose version 41161da)Thank you for getting back to me so promptly, @ndeloof. In my case, there seems to be no valid reason for the issue I’m facing. It appears to be a chain of docker-compose files where the last one is adding the same volumes again. Unfortunately, I cannot modify it as the base docker-compose files are managed by a custom framework.
In version <= 2.23, errors were ignored or overwritten silently. However, this is no longer the case, resulting in a breaking change.