Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo cannot log in to docker registry when username contains a dollar sign

Harbor uses the $ sign in the username for robot accounts. When using this account in Bamboo to access a private registry the login fails:

08-Apr-2020 15:14:44 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:116)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:73)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:184)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:156)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:130)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:118)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:124)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.lambda$start$0(DefaultBuildAgent.java:108)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
08-Apr-2020 15:14:44 at java.lang.Thread.run(Thread.java:745)
08-Apr-2020 15:14:44 Caused by: com.atlassian.bamboo.docker.DockerException: Error running Docker push command. See messages above for details.
08-Apr-2020 15:14:44 at com.atlassian.bamboo.plugins.docker.client.DockerCmd.push(DockerCmd.java:164)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.plugins.docker.service.PushService.execute(PushService.java:37)
08-Apr-2020 15:14:44 ... 17 more
08-Apr-2020 15:14:44 Caused by: com.atlassian.utils.process.ProcessException: Error executing '/usr/local/bin/docker login -u robot$bamboo --password-stdin registry.example.com', exit code: 125
08-Apr-2020 15:14:44 at com.atlassian.bamboo.plugins.docker.process.DefaultDockerProcessService.execute(DefaultDockerProcessService.java:66)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.plugins.docker.process.DefaultDockerProcessService.executeSilently(DefaultDockerProcessService.java:76)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.plugins.docker.process.DockerTaskProcessService.executeSilently(DockerTaskProcessService.java:79)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.plugins.docker.client.DockerCmd$AuthorisedCommand.login(DockerCmd.java:239)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.plugins.docker.client.DockerCmd$AuthorisedCommand.execute(DockerCmd.java:210)
08-Apr-2020 15:14:44 at com.atlassian.bamboo.plugins.docker.client.DockerCmd.push(DockerCmd.java:152)
08-Apr-2020 15:14:44 ... 18 more

Running the login command from the error message directly on the command line fails as well:

/usr/local/bin/docker login -u robot$bamboo registry.example.com
Password:
Error response from daemon: Get https://registry.example.com/v2/: unauthorized: authentication required

Surrounding the username with quotes solves this on the command line:

docker login -u 'robot$bamboo' registry.example.com
Password:
WARNING! Your password will be stored unencrypted in /home/bamboo/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

But I can't use that in the task configuration. I tried to enter the username in the following ways into the textbox:

  • 'robot$bamboo'
  • "robot$bamboo"
  • robot\$bamboo

But it doesn't matter, it's always the same result. When I log in to the registry on the agent host and select Use the agent's native credentials it works as well, but I'd rather not have to manually log in to every agent host individually.

How can I use such a username in a Docker task?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center is here!

G’day Bamboo customers, The wait is over! Bamboo Data Center edition you have been asking for is finally here! This self-managed enterprise offering of Bamboo has the resilience, reliability, and s...

534 views 1 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you