azure-pipelines-tasks: Docker Inspect throws exit code 125 due to not finding some layer IDs in final built image.
New issue checklist
- I searched for existing GitHub issues
- I read pipeline troubleshooting guide
- I checked how to collect logs
Task name
Docker@2
Task version
2.243.0
Issue Description
Using Podman v4.9.3 with container image Ubuntu:24.04. ADO agent is running inside the container.
The image is build successfully with the Docker@2 task using Podman. The issue is that at the end of the build, the Docker@2 Task is running Docker Inspect to inspect the built image.
This is where Docker Inspect is throwing an error because not all the layers of the built image have an ID or Name. This is a known strategy by docker where it does not write layers ID for ALL the image layers in history.
This issue is also raised in the official Podman repo ISSUE#21198.
Is there any change that has been applied to the Docker@2 Task, that gets affected by the image layer IDs in history?
Is there a workaround on this, like forcing the Docker@2 Task to NOT run Docker Inspect at the end of the build?
Or finally, can someone please review this and maybe apply a fix since it make the Docker@2 Task use with Podman simply unusable since it breaks the Pipeline?
Environment type (Please select at least one enviroment where you face this issue)
- 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
Ubuntu:24.04
Relevant log output
Skip to main content
Azure DevOps
Account manager for Kapasakalidis, Panagiotis
Jobs in run #ephemeral_agents_test_manual_podman_1252
Build and Push to OpenShift
View raw log
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;correlationId=6f38dde4-97d1-495d-a1e1-226e2fcd0faa;]Error: no names or ids specified
##[debug]task result: Failed
##[error]Unhandled: The process '/usr/bin/docker' failed with exit code 125
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;correlationId=6f38dde4-97d1-495d-a1e1-226e2fcd0faa;]Unhandled: The process '/usr/bin/docker' failed with exit code 125
##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: The process '/usr/bin/docker' failed with exit code 125
##[error]Error: The process '/usr/bin/docker' failed with exit code 125
at ExecState._setResult (/azp/agent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1249:25)
at ExecState.CheckComplete (/azp/agent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1232:18)
at ChildProcess.<anonymous> (/azp/agent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1160:19)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
at Process.callbackTrampoline (node:internal/async_hooks:130:17)
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;correlationId=6f38dde4-97d1-495d-a1e1-226e2fcd0faa;]Error: The process '/usr/bin/docker' failed with exit code 125
at ExecState._setResult (/azp/agent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1249:25)
at ExecState.CheckComplete (/azp/agent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1232:18)
at ChildProcess.<anonymous> (/azp/agent/_work/_tasks/Docker_e28912f1-0114-4464-802a-a3a35437fd16/2.243.0/node_modules/azure-pipelines-task-lib/toolrunner.js:1160:19)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
at Process.callbackTrampoline (node:internal/async_hooks:130:17)
Full task logs with system.debug enabled
Attached Full System Logs Podman_Pipeline_Docker_Task_Issue_logs_1252.zip
Repro steps
Attached Podman Pipeline Job YAML Podman_ADO_Pipeline_YAML.txt
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (3 by maintainers)
Hi, We have started our investigation on this issue. Previously, the task-lib didn’t catch promise rejections earlier but this was fixed in version 4.0.2.
The issue is there in the Docker task itself, which isn’t working correctly when layerId is missing. The task is expecting layerid to proceed but layerid is missing in the logs. Docker’s developers says that it’s expected behavior, so we probably need to change task’s logic when it’s missing.
@johnwc I had to use Docker@2.240.3, but my builds are now back to functional with this change only.
duplicate #20189
@johnwc This is great!!!
I however switched to the Bash ADO Task and I am building and pushing from the command line until this is resolved for good.
I will also try to open an enterprise support ticket with Microsoft, based on our findings. Maybe they will be able to review and fix it for future sprints.
P.S. Didn’t have time today to test the Podman Inspect output, but I will try later this week.
@johnwc good idea downgrading the Task. Will try to do that.
I will also try to run podman inspect -f {{.RootFS.Layers}} with a Bash Task to check what the output will be. This is the same command that the Docker@2 Task runs on the image.
Last, I will try to run docker inspect on my local Docker Desktop to identify any changes and report back to the Podman repo issue and this issue.
If the Task’s code is the problem, I am not that optimistic that Microsoft will try to add a fix, considering that Podman is not officially supported by this Task. Nevertheless, since MS always claims that they embrace open source, maybe they will take a leap into fixing this, who knows.
Podman is an important app (at least for my company), more secure than docker, and used by many users and companies (like Redhat OpenShift - they are building their container images with Podman).
If all else fails, then I will just use Podman build in a Bash Task and instruct my users to do the same when they use the Agents. But this will negate the use of the useful combo Build&Push option that the Docker@2 Task offers, but what can we do…
Anyways, I will be posting updates with my findings soon.
Thanks for looking and testing this as well.