-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[BUG]: DockerCompose@1 failed with Version mismatch error #20275
Comments
Could you please help us to sort as this occurred after latest changes done to this task |
@CharanGali, since version property is obsolete, the temporary fix is removing the version property from your own docker compose file if this error is blocking for you. Could you please provide a minimal example with a pipeline and a docker-compose YAML file to reproduce it? |
@ivanduplenskikh Thanks for your response and below is the requested information. We have used the below task in pipeline.
docker-compose-win2022.yml file contents are as below
Also, we have tried to remove the version from above docker file - still we receive the message as compose path is not found
Could you please help us ? |
Also, to add on - when we remove the dockercomposepath from task. we receive error as |
@CharanGali, you have four different errors and warnings in this case. The warning message about different version properties in YAMLThe message about different version in your pipeline output indicates that you have two different versions in a generated task's YAML and your docker-compose-win2022.yml YAML ##[error]Version mismatch: file D:\a\1\s\Sources\Integration Tests\Docker\docker-compose-win2022.yml specifies version 3.9 but extension file C:\agents\3.242.1\.docker-compose.1723125556266.yml uses version 1 You can resolve this by removing the version property from your YAML. time="2024-08-13T13:14:13+02:00" level=warning msg="C:\\a\\_work\\1\\s\\DockerComposeV0\\docker-compose-win2022.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion" This default Docker warning message means that you don't need to specify the version. Exit code 1The error in your output indicates that your container terminated due to a problem with an image, an invalid reference, or a similar issue. ##[error]The process 'C:\ProgramData\docker-compose\docker-compose.exe' failed with exit code 1 The problem with dockerComposePath inputYou mentioned that you removed the version from Docker file and still received the message that the compose path is not found. ##[error]Unhandled: Unable to locate executable file: 'C:\ProgramData\docker-compose\docker-compose.exe'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file. The version property doesn't affect this input. This error usually appears when there are no Docker Compose instances at the specified path. Exit code 15I see that your next step was deleting the dockerComposePath input, which helped you proceed with task interaction, but you encountered another error. ##[error]The process 'C:\Windows\system32\docker.exe' failed with exit code 15 This exit code usually appears when you have a project name that doesn't pass the strict Docker Compose constraints for project names. Here is my minimal working example based on yours. In this example Docker Compose doesn't produce any warnings or errors. service.ymlservices:
service:
image: ubuntu:latest azure-pipelines.ymlvariables:
- name: System.Debug
value: true
steps:
- task: DockerCompose@1
displayName: Run a Docker Compose command
inputs:
containerregistrytype: 'Container Registry'
dockerComposeFile: './service.yml'
action: 'Run a Docker Compose command'
projectName: 'test'
dockerComposeCommand: 'up'
arguments: '-d' |
Thanks for your inputs. we are able to use the latest version of DockerCompose@1 task and execute. |
New issue checklist
Task name
DockerCompose
Task version
1.243.1
Issue Description
A bug happened!
While using the task DockerCompose@1, received below error and failed
##[error]Version mismatch: file D:\a\1\s\Sources\Integration Tests\Docker\docker-compose-win2022.yml specifies version 3.9 but extension file C:\agents\3.242.1.docker-compose.1723125556266.yml uses version 1
##[error]The process 'C:\ProgramData\docker-compose\docker-compose.exe' failed with exit code 1
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
Windows
Relevant log output
Full task logs with system.debug enabled
While using the task DockerCompose@1, received below error and failed
##[error]Version mismatch: file D:\a\1\s\Sources\Integration Tests\Docker\docker-compose-win2022.yml specifies version 3.9 but extension file C:\agents\3.242.1.docker-compose.1723125556266.yml uses version 1
##[error]The process 'C:\ProgramData\docker-compose\docker-compose.exe' failed with exit code 1
Repro steps
The text was updated successfully, but these errors were encountered: