Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Docker task tries to log out of a new private registry before it has even logged in

I've set up a new Docker registry and I created my first build plan that would use it. I set up a Docker build task and a Docker push task.

I created shared credentials for my Docker registry and set to use those in my push task.

But now I ran into a problem: For some reason the push task tries to log out of the new registry but it has never logged into it yet.

simple	08-Jul-2019 11:28:54	Starting task 'Push image' of type 'com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli'
command	08-Jul-2019 11:28:54	Beginning to execute external process for build 'X - Default Job #4 (SYN-GATE-JOB1-4)'\n ... running command line: \n/usr/bin/docker logout truncated.registry.tld\n ...

 Thus that is causing my build to fail with an error:

build	08-Jul-2019 11:28:55	Not logged in to truncated.registry.tld
error	08-Jul-2019 11:28:55	Error occurred while running Task 'Push image(3)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli.

How can I fix this?

1 answer

1 accepted

2 votes
Answer accepted

We had a slightly similar support case recently, so I'm paraphrasing parts of our insights back then to hopefully help you narrow down the root cause:

  1. Inspecting the Docker task's source code confirms that the 'docker logout' command and resp. log output are misleading, because the command is in fact always executed after the selected Docker task action (like 'push' in your case, see 3), but always logged before that action's log due to the way the code is architected (addressing this log usability flaw would be for Atlassian to implement accordingly).
  2. Your Docker push fails because it is not properly authenticated, which yields this output (see 3 for a successful push):
    Not logged in to truncated.registry.tld
    I can reproduce this by providing an erroneous password for one of our own repositories:
    Not logged in to [...].dkr.ecr.us-east-1.amazonaws.com
  3. However, a successful push yields the following output instead (i.e. 'docker logout' is still executed):
    Removing login credentials for [...].dkr.ecr.us-east-1.amazonaws.com

So your provided credentials are seemingly not working - I have encountered two different root causes:

I. Credentials copy & paste error

Is it possible that you have e.g. accidentally pasted the username (or resp. Bamboo variable) into both the 'Username' and the 'Password' fields of the Bamboo Docker task?

This still happens to me every now and then, because the 'Password' field is masked, making it difficult to verify whether one has actually copied and pasted the correct snippet into the field. And it has indeed also been the root cause for our support case, i.e. our customer ran into the very same usability issue.

II. Outdated Docker version

This is explained in more detail in our resp. KB Bamboo Docker task fails due to ProcessException: Error executing '/usr/bin/docker login ...', exit code: 125, here's the TL;DR:

Cause

[...]

Under the hood, the Bamboo Docker task is using a docker login command line including the meanwhile unsupported --email or -e flag, as confirmed by the resp. issue Docker Task: -e required for docker push command (BAM-18613). The --email or -e flag has been removed as of Docker version 17.06.0-ce, so an upgrade to this or a newer Docker version without an accompanying upgrade of the Bamboo Docker task will yield the exception at hand.

Solution

You should upgrade to a newer Bamboo release that addresses this problem - according to Docker Task: -e required for docker push command (BAM-18613) the first version that includes this fix seems to be 6.2.0.

If you cannot upgrade your Bamboo version right away, you might be able to apply one of the workarounds outlined on BAM-18613.

Indeed this was the case.

The registry uses robot accounts and the passwords generated for those are pretty long. My only theory was that yesterday my clipboard was not copying the password entirely. I went over the password again and sure enough, my images were pushing to the registry.

Thank-you very much for the help and also describing a previous case where this was found, it was a good read.

Suggest an answer

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

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

190 views 4 6
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