Unable Pull Code from Stash

I have bamboo and Stash on the same Windows Server 2008 machine. Bamboo on port 8085 and Stash on 7990.

Bamboo service is running as one user whil Stash runs as another.

I've tried installing GIT for Windows, cygwin for ssh, .ssh/config modifications and all without success.

I just don't think bamboo is using the right keys or at least the user is not the user running the service.

Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command C:\GitStack\git\bin\git.exe ls-remote ssh://<UUID>@127.0.0.1:53634/SPEC/repo.git failed with code 128. Working directory was [.]., stderr:
[Host key verification failed., fatal: Could not read from remote repository., , Please make sure you have the correct access rights, and the repository exists.]

Bamboo Version: 4.4.4 build 3506 - 28 Feb 13

Stash version: 2.2.0

I'm running trial license of stash so my time is limited.

3 answers

1 accepted

This widget could not be displayed.

Solved my problem. Originally, we had authenication errors and took to the interwebs for resolution. Many Atlassian Answers and Jira tickets led us to believe the built-in Git was at fault.

So we removed the suggested third-party Git from server capabilities. With the built-in Git, we were able to successfully pull code.

This widget could not be displayed.

Which version of Bamboo is it?

Older versions have problems if the temp directory contains a space in its name. Try creating c:\somedir and passing -Djava.io.tmpdir=c:\somedir to you Bamboo.

4.4.4 build 3506 - 28 Feb 13

This widget could not be displayed.

Stash ships with an embedded SSH server and does not use the SSH configuration of the server it's been installed on. You'll need to upload the public key that Bamboo is using to Stash (Profile > SSH Keys > Add Key).

Also make sure you use the SSH port that is listed in the SSH clone urls displayed in Stash as the Stash SSH port may differ from the default SSH port on the server.

"You'll need to upload the public key that Bamboo"

How do I find out which key Bamboo is using?

Hi John,

You will need to set the authentication type and upload a private key as part of the repository information in Bamboo. The corresponding public key can then be uploaded to Stash. You may need to generate a new or separate key if you don't already have one.

https://confluence.atlassian.com/display/BAMBOO/Git

Cheers,

Charles

Hi John,

Just out of curiosity using the same URL as Bamboo can you clone to your desktop or manually from the server itself? Does it give you the same error? If you do, you could possible use the following scripts to clone and attach the log file to a new support ticket.

https://bitbucket.org/atlassian/git-client-debug/

Cheers,

Charles

I've done the generating. This is what I did:

From my desktop I generated a key, pasted the public key content into my profile of Stash.

Then in Bamboo created a plan with a Git repo. Chose SSH auth and uploaded my private key and entered a passcode.

Saved.

Added a Git checkout task to the Default stage.

Saved.

Then Run Plan.

The result is the error I mentioned in the primary question.

Yes. No, error. Locally it works fine. I can clone to my desktop and from command line of the Bamboo server. It's only when Bamboo itself does the clone does it fail.

Now I mentioned Bamboo server runs as a different user and not me. So I'm not sure which user@domain is coming across to Stash.

Hi John,

Sorry for the delay. I didn't have access to a computer over the weekend. I'm afraid we're not entirely sure what's going wrong. Can you triple-check that the SSH URL that you're using for Stash is exactly the same as what you used from the command line on the server. Do you mind posting that here as well. I ask because the <UUID> part of your initial question is a little concerning and not what we would expect. Maybe a screenshot of the Bamboo configuration?

If that doesn't help you're best bet to raise an actual support ticket so we can ask you to post the support zip which might shed some more light on the issue.

Cheers,

Charles

Re-checked the SSH URL from Stash and all is correct.

I omitted the UUID to save on real estate.

EDIT the Path for Executable Git is incorrect. I was getting a bit desperate during my debugging session.

Hi John,

I don't feel like we're getting anyway, and we'd like to help. If you haven't already please raise a support ticket so we can arrange a screensharing session to help you resolve this issue.

Cheers,

Charles

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