Plan branch auto-merge / push fails with authentication error

Bamboo build works all the way so rest of stash / git integration works as far as clone / checkout is concerned.

But when Bamboo attempts the plan branch merge and push, I get the following error. I don't know what is running at 127.0.0.1:39399 where bamboo is trying to connect for a git server and why it fails authentication.

Push command error: Warning: Permanently added '[127.0.0.1]:39399' (RSA) to the list of known hosts. fatal: remote error: Not authenticated Please authenticate and try your request again. fatal: The remote end hung up unexpectedly

In the atlassian-bamboo.log:

2014-03-05 15:22:20,675 WARN [AtlassianEvent::0-BAM::EVENTS:pool-3-thread-15] [ChainExecutionManagerImpl] Exception during push: command /usr/bin/git push ssh://0f041d59-7d1f-4429-8f16-e1b31c8dfac2@127.0.0.1:39399/kon/kumo-one.git feature/KON-2-test-jira-bamboo-integration failed with code 128. Working directory was [/opt/atlassian/bamboo-home/xml-data/build-dir/serverSide/KONE-K1CI1-10/mergeWorkspace]., stderr:

Warning: Permanently added '[127.0.0.1]:39399' (RSA) to the list of known hosts.

fatal: remote error: Not authenticated

Please authenticate and try your request again.

fatal: The remote end hung up unexpectedly

4 answers

This widget could not be displayed.

Hi Rajul,

In Bamboo, by selecting "Source Code Checkout" in your plan, Bamboo will checkout from your repository and add to the remote.origin.url property the following information:

remote.origin.url=file:///<bamboo-home>/xml-data/build-dir/_git-repositories-cache/cdb8458fd0ffa89a43202ab15c042155b41362c1

In can get this information by going to <bamboo-home>/xml-data/build-dir/<project-key>-<plan-key>/ and running the following command in your Command Prompt/Terminal:

git config -l

In order to be able to push code to your repository by, the property remote.origin.url needs to be updated to the http(s)/ssh to your repository. You can acchieve that by creating a Script task and adding the following to it:

# remove remote.origin.url value
git remote remove origin
# add remote.origin.url value
# you can get this information from the clone information to your repository
git remote add origin ssh://git@&lt;stash-domain&gt;:7999/&lt;project-key&gt;/&lt;repository&gt;.git
# create a new file
echo "Hello World" &gt; greeting.txt
# add file
git add greeting.txt
# commit
git commit -m "add greeting"
# push to the repository
git push origin master

Kind regards,
Rafael

This widget could not be displayed.

I'm getting the same problem as Rajul.

Any clue?

This widget could not be displayed.

We are getting the same problem. Were getting the error in Bamboo 5.4.2 connected to Stash 2.11.2 and thought upgrading to Bamboo 5.5.1 connected to Stash 2.11.2 via the new Stash Application link might solve the problem. It did NOT. Please advice.

This widget could not be displayed.

I'm getting the same error with Bamboo 5.6.2 and Stash 3.4.0. The output of the command git config -l on the folder  <bamboo-home>/xml-data/build-dir/<project-key>-<plan-key>/  is the correct repository url.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

150 views 1 3
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you