microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.42k stars 2.58k forks source link

[BUG]: DockerCompose task compatibility mode issue #20045

Open sadmdbrezack-metabolon opened 1 week ago

sadmdbrezack-metabolon commented 1 week ago

New issue checklist

Task name

DockerCompose

Task version

0.240.2

Issue Description

https://github.com/microsoft/azure-pipelines-tasks/blob/fa06ce1ef02d3556c1abe73be1c9f3ea1a706a1f/Tasks/DockerComposeV0/dockercomposeconnection.ts#L99

Docker no longer supports comparability flag in newer versions. This should be removed or we need a flag to disable compatibility mode. Happy to ship a fix if someone wants to help walk me through it

Dockercompose git for reference https://github.com/docker/compose/issues/8618#issuecomment-922719973

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

All

Relevant log output

unknown flag: --compatibility

Full task logs with system.debug enabled

No response

Repro steps

No response

okamilobo commented 1 week ago

This has taken down all of our builds so we would appreciate rapid resolution.

okamilobo commented 1 week ago

We worked around by specifying a path to the docker-compose.exe and will be working on moving to a more recent version.

sleipper commented 1 week ago

This relate to recent uodates https://learn.microsoft.com/en-us/azure/devops/release-notes/2024/sprint-240-update#dockercompose0-uses-docker-compose-v2-in-v1-compatibility-mode that flag isn't supported in later versions.

v-schhabra commented 1 week ago

Hi @sadmdbrezack-metabolon Thanks for reporting this issue. Could you please share the complete debug logs of the pipeline by adding variable system.debug to "true"?

severindheureuse commented 1 week ago

Hi, I worked around this issue by specifying a projectName (in lowercase) in the azure-pipeline.yml DockerCompose@0 task.

sadmdbrezack-metabolon commented 1 week ago

For anyone that is having issues with this you can set the docker compose path until this gets fixed.

dockerComposePath: '/usr/local/bin/docker-compose'

sadmdbrezack-metabolon commented 1 week ago

Hi @sadmdbrezack-metabolon Thanks for reporting this issue. Could you please share the complete debug logs of the pipeline by adding variable system.debug to "true"?

Run docker compose --compatibility up with any newer version of docker to recreate.

Removing line 99 should fix.

Peralysis commented 1 week ago

I found that as a temporary workaround I can disable the --compatibility switch from being passed by adding a variable with the name USE_DOCKER_COMPOSE_V2_COMPATIBLE_MODE to the pipeline and setting the value to false. This variable gets passed to the task as an environment variable and is picked up as a feature flag that disables the block of code that adds the problematic --compatibility flag.

image

v-schhabra commented 1 week ago

Hello Everyone, For now we have disabled the FF DistributedTask.Agent.UseDockerComposeV2CompatibleMode for all the organizations. I hope you will not be having any issues related to compatibility mode.

w1s3one805 commented 4 days ago

New issue checklist

Task name

DockerCompose

Task version

0.240.2

Issue Description

https://github.com/microsoft/azure-pipelines-tasks/blob/fa06ce1ef02d3556c1abe73be1c9f3ea1a706a1f/Tasks/DockerComposeV0/dockercomposeconnection.ts#L99

Docker no longer supports comparability flag in newer versions. This should be removed or we need a flag to disable compatibility mode. Happy to ship a fix if someone wants to help walk me through it

Dockercompose git for reference https://github.com/docker/compose/issues/8618#issuecomment-922719973

Environment type (Please select at least one enviroment where you face this issue)

  • [X] Self-Hosted
  • [ ] Microsoft Hosted
  • [ ] VMSS Pool
  • [ ] Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

All

Relevant log output

unknown flag: --compatibility

Full task logs with system.debug enabled

No response

Repro steps

No response