Docker API responded with status code=Forbidden

Neil Scales January 10, 2025

I've started getting this error during a C# build pipeline that tests some code:

 

Docker.DotNet.DockerApiException : Docker API responded with status code=Forbidden, response={"message":"authorization denied by plugin pipelines: Invalid request"}

The tests spin up a docker container to hold the mysql database that is used for integration tests.  This part is not new.

This problem started when the code was upgraded from net6 to net8, but the pipeline was already running on the net8 SDK, and previously the net6 SDK was installed as part of the build, before any testing.   Now it just build and runs the tests as net8.

The docker build logs contain this:

time="2025-01-10T14:13:48.173467253Z" level=error msg="AuthZRequest for HEAD /_ping returned error: authorization denied by plugin pipelines: "
time="2025-01-10T14:15:11Z" level=info msg="Pipelines plugin request authorization." allowed=false method=POST plugin=pipelines uri=/containers/create

2 answers

1 vote
Sahir Maharaj
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 10, 2025

Hello @Neil Scales

This issue likely stems from changes in how requests are handled in .NET 8, potentially affecting the way your pipeline interacts with Docker. Here’s what I would suggest to troubleshoot and resolve the issue:

Ensure the user running the build pipeline has adequate permissions to interact with Docker. Verify that this user is added to the docker group on the host machine, which allows non-root users to manage Docker.

The Pipelines plugin seems to be rejecting the authorization request. Check the plugin configuration to ensure it permits Docker operations for your pipeline's user. You may need to update the plugin's settings to align with the changes introduced by .NET 8.

Hope this helps.

0 votes
Neil Scales January 10, 2025

@Sahir Maharaj 

The pipeline plugins and build users are controlled by Bitbucket, aren't they?  The Docker/host is a Bitbucket thing, not something I've set up.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events