Docker not working properly on Ubuntu 20.04 hosted agent

Hardeep Sidhu 1 Reputation point
2022-09-21T23:32:29.827+00:00

Error: Docker.DotNet.DockerApiException: Docker API responded with status code=BadRequest, response=400 Bad Request.
Hosted agent: ubuntu-20.04 (full agent details below)
Issue first observed: Sept. 21 at 11:55 AM PDT. The issue was not observed on a pipeline run on Sept. 21 at 3:00 AM PDT.

We use the Docker.DotNet library to create Docker containers as part of integration tests run in some of our build pipelines. This had been working without issue, including earlier today, but is now failing with the above error.

Output from the Initialize job step:
2022-09-21T21:20:36.4375308Z ##[section]Starting: Initialize job
2022-09-21T21:20:36.4376635Z Agent name: 'Hosted Agent'
2022-09-21T21:20:36.4377121Z Agent machine name: 'fv-az30-999'
2022-09-21T21:20:36.4377368Z Current agent version: '2.210.1'
2022-09-21T21:20:36.4412842Z ##[group]Operating System
2022-09-21T21:20:36.4413127Z Ubuntu
2022-09-21T21:20:36.4413281Z 20.04.5
2022-09-21T21:20:36.4413434Z LTS
2022-09-21T21:20:36.4413590Z ##[endgroup]
2022-09-21T21:20:36.4413774Z ##[group]Runner Image
2022-09-21T21:20:36.4413976Z Image: ubuntu-20.04
2022-09-21T21:20:36.4414167Z Version: 20220920.2
2022-09-21T21:20:36.4414508Z Included Software: https://github.com/actions/runner-images/blob/ubuntu20/20220920.2/images/linux/Ubuntu2004-Readme.md
2022-09-21T21:20:36.4414966Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu20%2F20220920.2
2022-09-21T21:20:36.4415245Z ##[endgroup]
2022-09-21T21:20:36.4415448Z ##[group]Runner Image Provisioner
2022-09-21T21:20:36.4415782Z 1.0.0.0-main-20220916-1
2022-09-21T21:20:36.4415963Z ##[endgroup]
2022-09-21T21:20:36.4416849Z Current image version: '20220920.2'
2022-09-21T21:20:36.4418802Z Agent running as: 'vsts'
2022-09-21T21:20:36.4458322Z Prepare build directory.
2022-09-21T21:20:36.4697852Z Set build variables.
2022-09-21T21:20:36.4729103Z Download all required tasks.
2022-09-21T21:20:36.4839437Z Downloading task: UseDotNet (2.207.2)
2022-09-21T21:20:38.4979658Z Downloading task: CmdLine (2.201.1)
2022-09-21T21:20:38.7267818Z Downloading task: DotNetCoreCLI (2.208.1)
2022-09-21T21:20:39.4407847Z Checking job knob settings.
2022-09-21T21:20:39.4418190Z Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY}
2022-09-21T21:20:39.4419640Z Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG}
2022-09-21T21:20:39.4421633Z Finished checking job knob settings.
2022-09-21T21:20:39.4778635Z Start tracking orphan processes.
2022-09-21T21:20:39.4957822Z ##[section]Finishing: Initialize job

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,367 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Hardeep Sidhu 1 Reputation point
    2022-09-22T18:18:42.883+00:00

    Following up on this. This issue is preventing several of our CI pipelines from completing. We have tested on both ubuntu-20.04 and ubuntu-22.04 and they are both failing. I believe an update was made to the hosted agent images around 09/21/22 08:00AM PDT (https://github.com/actions/runner-images/commit/6956bec628d22e07126164a7aa47fdaf032deec0) which I'm suspecting is where the problem was introduced.

    The error reported by the Docker.DotNet library is Docker.DotNet.DockerApiException: Docker API responded with status code=BadRequest, response=400 Bad Request.

    This error is being observed on pipelines where we haven't made any other changes and the exact same code was working correctly before yesterday.

    0 comments No comments

  2. Hardeep Sidhu 1 Reputation point
    2022-09-27T19:34:07.063+00:00

    An update if anyone else runs into this issue: this issue was resolved by updating from Docker.Dotnet 3.125.2 to 3.125.12.

    0 comments No comments