Open lemmy04 opened 3 years ago
here's my compose file:
tk4:
mem_reservation: 96M
mem_limit: 128M
container_name: tk4
hostname: akari
image: rattydave/docker-ubuntu-hercules-mvs:latest
net: bridge
ports:
- 3270:3270/tcp
- 8038:8038/tcp
privileged: true
tty: true
stdin_open: true
restart: unless-stopped
volumes:
- /home/mathias/hercules_mode:/opt/hercules/tk4/unattended/mode
environment:
- NUMCPU=1
- MAXCPU=1
Up to portainer 2.0.x it worked fine - now in portainer 2.1.1 I can't do anythign with it, I can't start the stack, and without the stack running i can't edit the compose file either.
Ticket update by Bala Natarajan (bala.Natarajan@portainer.io)
Hi
pl confirm if the setup is on ARM/ARM64.
nope, X86_64, docker running on openSUSE Leap 15.2
Remarking this for dev investigation. @lemmy04 , have you got any other log files you are able to sharE?
I was able to deploy the above stack to Portainer v 2.0.0 but not into 2.1.1
I believe in 2.1.1 when a version is not specified, its interpreted as Version 3 (not 2). In this case the YML that 's used is not valid for Docker Compose Version 3
portainer 2.5.1 - this bug is still around.
Hi, you'll need to specify the version. (libcompose always assumes v2, but docker compose doesn’t)
But I assume that you can't edit the stack (to add the version in) because it's stopped?
exactly. Also, the default behaviour for the docker-compose command is to "assume" Version 1 when there's no version info in a compose file, so I don't think portainer should deviate from that... and there is no way to "specify" version 1.
It's even in the portainer logs:
2021/05/31 06:28:24 http error: Version in "/data/compose/25/docker-compose.yml" is invalid. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services
key, or omit the version
key and place your service definitions at the root of the file to use version 1.
@lemmy04 yes, we're going to work on https://github.com/portainer/portainer/issues/4944 which will allow you to update the version of a stopped stack to solve this problem.
Since this ticket was opened, the version
element has been deprecated. The compose specification has this to say:
Top-level version property is defined by the specification for backward compatibility but is only informative.
A Compose implementation SHOULD NOT use this version to select an exact schema to validate the Compose file, but prefer the most recent schema at the time it has been designed.
I too have run into this issue now. And not sure how to fix it. Portainer version 2.18.4. Omitting the version, I get a notification unsupported Compose file version: 1.0
. Which sucks, because I need to manipulate the startup order of containers. The depends_on
keyword can be used in stack deploy on the latest compose version, according to Docker docs.
Still an issue on 2.19.5
Bug description I can't start, edit, or delete an old stack because the format is wrong
Expected behavior I would expect to be able to start, edit or delete an existing stack
Portainer Logs
2021/03/25 13:31:21 http error: Unable to stop stack (err=The Compose file '/data/compose/95/docker-compose.yml' is invalid because:
Unsupported config option for tk4: 'mem_reservation'
Steps to reproduce the issue:
Technical details:
docker run -p 9000:9000 portainer/portainer
):Additional context according to the docker-compose documentation, a compose file without version header is interpreted as version 1 - but inside portainer it is misinterpreted as something else, most likely version 2, which breaks every pre-existing stack.