Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Compose does not run with new image windows-2022 with Docker 23.00 - The current Compose file version is not compatible with your engine version. #7080

Closed
2 of 10 tasks
meneasysoft opened this issue Feb 9, 2023 · 21 comments
Assignees
Labels
Area: Containers awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report OS: Windows

Comments

@meneasysoft
Copy link

meneasysoft commented Feb 9, 2023

Description

I think docker compose v2 2.15.1 is not compatible with Docker 23.00 shipped with the new windows image ( https://github.com/actions/runner-images/blob/win22/20230206.1/images/win/Windows2022-Readme.md )

I think docker compose 2.16.0 should be integrated into the new windows-2022 image:
https://github.com/docker/compose/releases/tag/v2.16.0

I always get the following error since the new image is used:
##[error]The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.
##[error]The process 'C:\ProgramData\Chocolatey\bin\docker-compose.exe' failed with exit code 1

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Runner Image
Image: windows-2022
Version: 20230206.1

Included Software: https://github.com/actions/runner-images/blob/win22/20230206.1/images/win/Windows2022-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20230206.1

Is it regression?

Yes it still worked in
20230129.1

Expected behavior

The error: [error]The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.

should not occur and the compose command should work

Actual behavior

The error occurs: [error]The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.

Repro steps

In Azure-DevOps I use in the pipeline:

  - task: DockerCompose@0
    displayName: Run services
    inputs:
     containerregistrytype: 'Container Registry'         
     dockerComposeFile: 'build/docker/docker-compose.yml'
     dockerComposeFileArgs: 'DOCKER_BUILD_SOURCE=$(System.DefaultWorkingDirectory)'
     action: 'Run services'
     buildImages: false

My docker-compose (docker-compose.yml) file looks like this (details changed):

version: '3.0'

services:
  sqlserver:
    image: willh/mssql-server-windows-developer:latest
    container_name: sqlserver
    shm_size: 4gb
    ports:
      - "1433:1433"
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=a(!)Passcode

I did some adjustments to my pipeline and my docker-compose.yml file but that did not help.
More details here: https://stackoverflow.com/questions/75399574/azure-devops-compose-error-the-current-compose-file-version-is-not-compatible

@meneasysoft meneasysoft changed the title Docker Compose does not run with new image windows-2022 with Docker 23.00 Docker Compose does not run with new image windows-2022 with Docker 23.00 - The current Compose file version is not compatible with your engine version. Feb 9, 2023
@ddobranic
Copy link
Contributor

hello, @meneasysoft! thank you for reporting. we will take a look.

@VFedorV VFedorV self-assigned this Feb 10, 2023
@mikhailkoliada mikhailkoliada added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Feb 13, 2023
@mikhailkoliada
Copy link
Contributor

v2.16.0 will be a part of the next release

@mathias-kogler-snkeos
Copy link

Is there a workaround available?
When is the next release planned?

@meneasysoft
Copy link
Author

Thank you for the information about v2.16.0 being part of the next release.

My pipelines do not work any more until this is fixed.
I would also like to know whether there is a workaround or not and how long it will take for the next release.

Please also make sure that v2.16.0 will fixes the described issue. I am not able to see if this helps for myself. It is just my hope that this will help, looking at the release notes of docker-compose v2.16.0.

@SillyCode
Copy link

Will the fix be available on windows-2019?
I experience the same issue on it

@mikhailkoliada
Copy link
Contributor

It should be available by the end of the week on all OSes

@meneasysoft
Copy link
Author

meneasysoft commented Feb 17, 2023

@mikhailkoliada: Should this already work again?
With the following image the problem still is occuring:

Version: 20230214.1
Included Software: https://github.com/actions/runner-images/blob/win22/20230214.1/images/win/Windows2022-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20230214.1

@SillyCode
Copy link

@mikhailkoliada: Should this already work again? With the following image the problem still is occuring:

Version: 20230214.1 Included Software: https://github.com/actions/runner-images/blob/win22/20230214.1/images/win/Windows2022-Readme.md Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20230214.1

Just want to add. Same here.
With Windows-2019

@mikhailkoliada
Copy link
Contributor

Deployed

@SillyCode
Copy link

SillyCode commented Feb 19, 2023

Operating System
Microsoft Windows Server 2019
10.0.17763
Runner Image
Image: windows-2019
Version: 20230214.1

Still getting this issue:
The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.

My docker-compose:

version: "3.9"
services:
  sql-server-db:
    container_name: my-mssql
    image: my-mssql-image:latest
    ports:
      - "1433:1433"
    environment:
      SA_PASSWORD: "***************"
      ACCEPT_EULA: "Y"

As far as I can see the Docker compose is used via Choco.

You can see it here:
##[error]The process 'C:\ProgramData\Chocolatey\bin\docker-compose.exe' failed with exit code 1

See the log:

2023-02-19T08:22:09.0368683Z ##[debug]which 'docker-compose'
2023-02-19T08:22:09.0752496Z ##[debug]found: 'C:\ProgramData\Chocolatey\bin\docker-compose.exe'
2023-02-19T08:22:10.3052706Z [command]C:\ProgramData\Chocolatey\bin\docker-compose.exe -f D:\a\1\s\Sources\Tests\Docker\docker-compose.yml -f C:\agents\2.217.2\.docker-compose.1676794930282.yml -p SI up -d
2023-02-19T08:22:11.4679494Z Creating network "si_default" with the default driver
2023-02-19T08:22:12.0324536Z Pulling sql-server-db (***/my-mssql-image:latest)...
2023-02-19T08:22:14.8209567Z I2: Pulling from [i2-si-mssql](my-mssql-image:latest)
2023-02-19T08:32:54.0137344Z The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.
2023-02-19T08:32:54.9175774Z ##[debug]Exit code 1 received from tool 'C:\ProgramData\Chocolatey\bin\docker-compose.exe'
2023-02-19T08:32:54.9177252Z ##[debug]STDIO streams have closed for tool 'C:\ProgramData\Chocolatey\bin\docker-compose.exe'
2023-02-19T08:32:55.0020263Z ##[error]Pulling sql-server-db (***/my-mssql-image:latest)...
2023-02-19T08:32:55.0021455Z ##[debug]Processed: ##vso[task.issue type=error;]Pulling sql-server-db (***/my-mssql-image:latest)...
2023-02-19T08:32:55.0023243Z ##[error]The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.
2023-02-19T08:32:55.0025902Z ##[debug]Processed: ##vso[task.issue type=error;]The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.
2023-02-19T08:32:55.0117852Z ##[debug]task result: Failed
2023-02-19T08:32:55.0119880Z ##[error]The process 'C:\ProgramData\Chocolatey\bin\docker-compose.exe' failed with exit code 1

Environment path:
C:\agents\2.217.2\externals\git\cmd; C:\agents\2.217.2\externals\git\mingw64\bin; C:\Program Files\MongoDB\Server\5.0\bin; C:\aliyun-cli; C:\vcpkg; C:\cf-cli; C:\Program Files (x86)\NSIS\; C:\tools\zstd; C:\Program Files\Mercurial\; C:\hostedtoolcache\windows\stack\2.9.3\x64; C:\cabal\bin; C:\\ghcup\bin; C:\Program Files\dotnet; C:\mysql\bin; C:\Program Files\R\R-4.2.2\bin\x64; C:\SeleniumWebDrivers\GeckoDriver; C:\Program Files (x86)\sbt\bin; C:\Program Files (x86)\GitHub CLI; C:\Program Files\Git\bin; C:\Program Files (x86)\pipx_bin; C:\npm\prefix; C:\hostedtoolcache\windows\go\1.17.13\x64\bin; C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts; C:\hostedtoolcache\windows\Python\3.7.9\x64; C:\hostedtoolcache\windows\Ruby\2.5.9\x64\bin; C:\tools\kotlinc\bin; C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.362-9\x64\bin; C:\Program Files\ImageMagick-7.1.0-Q16-HDRI; C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin; C:\ProgramData\kind; C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Windows\System32\OpenSSH\; C:\ProgramData\Chocolatey\bin; C:\Program Files\PowerShell\7\; C:\Program Files\Microsoft\Web Platform Installer\; C:\Program Files\Microsoft SQL Server\130\Tools\Binn\; C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\; C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\; C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\; C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\; C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\; C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\; C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\; C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\; C:\Program Files\OpenSSL\bin; C:\Strawberry\c\bin; C:\Strawberry\perl\site\bin; C:\Strawberry\perl\bin; C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin; C:\Program Files\TortoiseSVN\bin; C:\Program Files\CMake\bin; C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.0\bin; C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code; C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager; C:\Program Files\nodejs\; C:\Program Files\Git\cmd; C:\Program Files\Git\mingw64\bin; C:\Program Files\Git\usr\bin; C:\Program Files\GitHub CLI\; c:\tools\php; C:\Program Files (x86)\sbt\bin; C:\SeleniumWebDrivers\ChromeDriver\; C:\SeleniumWebDrivers\EdgeDriver\; C:\Program Files\Amazon\AWSCLIV2\; C:\Program Files\Amazon\SessionManagerPlugin\bin\; C:\Program Files\Amazon\AWSSAMCLI\bin\; C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin; C:\Program Files (x86)\Microsoft BizTalk Server\; C:\Program Files\LLVM\bin; C:\Users\VssAdministrator\.dotnet\tools; C:\Users\VssAdministrator\.cargo\bin; C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps

It seems to me that the Docker compose in Choco takes precedes.
Not only that, I am unable to see in the environment variables that there is any other Docker-Compose setup.

@meneasysoft
Copy link
Author

meneasysoft commented Feb 20, 2023

I still have the same issue windows-2022 image.
So i can not confirm that this works.
There is still an issue. (removed the rest of the comment since it was not helpful, I did not want to start a discussion here about what or who is responsible for the problem - I apologize if this impression was made. )

@thomas000274
Copy link

thomas000274 commented Feb 20, 2023 via email

@meneasysoft
Copy link
Author

meneasysoft commented Feb 20, 2023

Yeah it's a great issue when someone thinks that they control over some issues they can't get past & blaming them instead of themselves. I'm accountable for mine: just a reaction. On Feb 20, 2023 12:23 AM, meneasysoft @.> wrote: I still have the same issue windows-2022 image. So i can not confirm that this works. There is still an issue and I am disappointed that this issue was closed without verifying that the actual problem was solved. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.>

-> I edited my comment and apologize if this could be misunderstood or I did not express myself in the way I intended it.

@miaooss
Copy link

miaooss commented Feb 20, 2023

Hi, I seem to have the same issue on the windows-2019. Using version docker compose file 2.2

Exception in thread Thread-21:
Traceback (most recent call last):
  File "threading.py", line 950, in _bootstrap_inner
  File "threading.py", line 888, in run
  File "compose\cli\log_printer.py", line 202, in watch_events
  File "compose\project.py", line 626, in yield_loop
  File "compose\project.py", line 594, in build_container_event
  File "compose\container.py", line 44, in from_id
  File "docker\utils\decorators.py", line 19, in wrapped
The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.
  File "docker\api\container.py", line 774, in inspect_container
  File "docker\utils\decorators.py", line 46, in inner
  File "docker\api\client.py", line 237, in _get
  File "requests\sessions.py", line 543, in get
  File "requests\sessions.py", line 530, in request
  File "requests\sessions.py", line 643, in send
  File "requests\adapters.py", line 439, in send
  File "urllib3\connectionpool.py", line 670, in urlopen
  File "urllib3\connectionpool.py", line 392, in _make_request
  File "http\client.py", line 1255, in request
  File "http\client.py", line 1301, in _send_request
Aborting on container exit...
##[error]PowerShell exited with code '1'.

@eleasysoft
Copy link

eleasysoft commented Feb 21, 2023

I have tested several docker images and repo and assume that is an issue with docker-compose on windows.
Depending on the docker-image, it sometimes works, sometimes not.
The given message "The current Compose file version is not compatible with your engine version." is wrong and do not point to the error.
I think that docker-compose do compare the builder-version of the image with the version of the executor, because I could solve the issue for me by re-building my image on the (windows) agent.
I couldn't find any reported issue in docker-compose, so I would be glad if someone could confirm it.
Regards, Éric.

@skotlar
Copy link

skotlar commented Feb 22, 2023

Nothing solved for hosted agents Windows 2019 and 2022
The only possible workaround is to run Powershell script downloading correct version of docker-compose.exe and then another script to run downloaded docker-compose.exe with all needed commands and parameters

@mathias-kogler-snkeos
Copy link

I figured out a workaround:

Calling docker-compose invokes the version installed via Chocolatey.

which docker-compose
/c/ProgramData/Chocolatey/bin/docker-compose

and as you can see here - that's the old version:

C:\ProgramData\Chocolatey\bin\docker-compose.exe --version
docker-compose version 1.29.2, build 5becea[4]

Looking at the install docker script for windows runners I figured out the path where docker-compose 2.16 is installed.

If I call C:\ProgramData\docker\cli-plugins\docker-compose.exe up instead of docker-compose up it works for me.

@SillyCode
Copy link

Can confirm that replacing the DockerCompose@0 task with a PowerShell task that explicitly calls the latest Docker Compose from C:\ProgramData\docker\cli-plugins works.

- task: PowerShell@2
      displayName: Run Docker-Compose
      inputs:
        targetType: 'inline'
        script: C:\ProgramData\docker\cli-plugins\docker-compose.exe -f docker-compose.yml up -d

Thanks @mathias-kogler-snkeos for the suggestion.

@eleasysoft
Copy link

Thanks @mathias-kogler-snkeos for pointing to the error.
You may also use 'dockerComposePath' to avoid rewriting all tasks.

- task: DockerCompose@0
  displayName: Run services
  inputs:
    action: Run services
    projectName: docker-compose
    ....
    dockerComposePath: 'C:\ProgramData\docker\cli-plugins\docker-compose.exe'

Fun fact:

docker compose version
docker-compose version

an returning different versions:

Docker Compose version v2.16.0
docker-compose version 1.29.2

This means, instead of using the absolut path, you could call "docker compose".

@SillyCode
Copy link

dockerComposePath does not work for me either

@thomas000274
Copy link

thomas000274 commented Feb 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Containers awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report OS: Windows
Projects
None yet
Development

No branches or pull requests

11 participants