overhangio/tutor

docker compose validations fail with docker-compose-plugin > 2.21

mariajgrimaldi opened this issue · 5 comments

Bug description

After upgrading to docker-compose-plugin 2.24.x the tutor dev start command started raising this error:

❯ tutor dev start -d
docker compose -f /home/tutor/nightly/env/local/docker-compose.yml -f /home/tutor/nightly/env/local/docker-compose.prod.yml --project-name tutor_nightly_local stop
docker compose -f /home/tutor/nightly/env/local/docker-compose.yml -f /home/tutor/nightly/env/dev/docker-compose.yml --project-name tutor_nightly_dev up --remove-orphans -d
validating /home/tutor/nightly/env/dev/docker-compose.yml: services.permissions.environment array items[0,1] must be unique
Error: Command failed with status 15: docker compose -f /home/tutor/nightly/env/local/docker-compose.yml -f /home/tutor/nightly/env/dev/docker-compose.yml --project-name tutor_nightly_dev up --remove-orphans -d

We figured it was the update so we downgraded the plugin:

sudo apt-get install docker-compose-plugin=2.21.0-1~ubuntu.22.04~jammy

Then, the start command started working again.

How to reproduce

  1. Upgrade your docker compose plugin to the 2.24 version. If you're using ubuntu:
    sudo apt-get install docker-compose-plugin=2.24.1-1~ubuntu.22.04~jammy
  2. Try running any command involving docker compose (start, stop, restart...)

Environment
Ubuntu 22.04
Tutor nightly commit: 8cab65d11416ca7df51d9d287c7f6411825ac8bb

regisb commented

Interesting. Can you please try to figure out which items from services.permissions.environment in /home/tutor/nightly/env/dev/docker-compose.yml are causing the issue?

I've confirmed that this is fixed with docker compose 2.24.2 but I'd created a local fix that I've pushed here: #994

I think we can just close that PR once it's no longer needed.

I forgot to attach the docker compose file. Here's the file from that day validating /home/tutor/nightly/env/dev/docker-compose.yml: services.permissions.environment array items[0,1] must be unique:

dockercompose-validation-error

Thank you folks @regisb @pomegranited @xitij2000!

Now I wonder, should we implement a tutor-native fix to avoid future failures or recommend not using 2.24.1?

I forgot to attach the docker compose file. Here's the file from that day validating /home/tutor/nightly/env/dev/docker-compose.yml: services.permissions.environment array items[0,1] must be unique:

dockercompose-validation-error

Thank you folks @regisb @pomegranited @xitij2000!

Now I wonder, should we implement a tutor-native fix to avoid future failures or recommend not using 2.24.1?

The PR I've made should fix this particular case of this error.

However, it's quite possible for other plugins etc to create config files that cause this error. I don't think there is a tutor-native fix that can solve it for all plugins. However, it does seem like this issue has been fixed on docker's side, though I didn't dig into whether it's a temporary fix to placate people that'll come back later as part of a larger release.