Failed to pull private image in Bitbucket pipelines

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

The user set up a private image to run a Bitbucket pipeline build However, the pull is failing to authenticate even though the correct credentials were passed in the YML configuration. The most likely scenario is that there is a whitespace at the beginning or end of the environment variable.

Environment

Bitbucket Pipelines

Solution

Go to the repository/workspace settings and verify if there are any white spaces in the variable.

(Auto-migrated image: description temporarily unavailable)

If yes, remove them and rerun the build.

If the environment variable is secure, there's no way to check. In this case, delete the environment variable and recreate it.

Updated on March 10, 2025

Still need help?

The Atlassian Community is here for you.