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

Jenkins Unable to Clone Stash Repository

Jeff Thomas Atlassian Team Oct 10, 2013

We're having trouble getting Jenkins to clone any of our Stash repositories over HTTP or HTTPS.

The URL in the Jenkins job is http://stash.company.com:7990/scm/project/repo.git, when the job is run, we get the following error in Jenkins:

Cloning repository http://stash.company.com:7990/scm/project/repo.git
git --version
git version 1.7.1
ERROR: Error cloning remote repo 'origin' : Could not clone http://stash.company.com:7990/scm/project/repo.git
hudson.plugins.git.GitException: Could not clone http://stash.company.com:7990/scm/project/repo.git
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:283)
	at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.clone(AbstractGitAPIImpl.java:59)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:46)
	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1012)
	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:948)
	at hudson.FilePath.act(FilePath.java:916)
	at hudson.FilePath.act(FilePath.java:889)
	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:948)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1114)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:657)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562)
	at hudson.model.Run.execute(Run.java:1665)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:246)
Caused by: hudson.plugins.git.GitException: Failed to connect to http://stash.company.com:7990/scm/project/repo.git
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1343)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1305)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:46)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:278)
	... 16 more
Trying next repository
ERROR: Could not clone repository
java.io.IOException: Could not clone
	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1025)
	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:948)
	at hudson.FilePath.act(FilePath.java:916)
	at hudson.FilePath.act(FilePath.java:889)
	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:948)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1114)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:657)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562)
	at hudson.model.Run.execute(Run.java:1665)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:246)
Finished: FAILURE

We require authentication for our repos and I'm currently trying to use a .netrc file to send the username and password. I've also tried passing the username and password in the URL (ie. http://user:pass@stash.company.com:7990/scm/project/repo.git).

Catalina.out for Jenkins seems to indicate that it's using an "Atlassian Stash" user.

Oct 10, 2013 4:10:13 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: basic authentication scheme selected
Oct 10, 2013 4:10:13 PM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge
INFO: No credentials available for BASIC 'Atlassian Stash'@stash.company.com:7990

I am able to clone the repository from the command line running as the Jenkins user.

git clone http://stash.company.com:7990/scm/project/repo.git

What am I doing wrong?

1 answer

1 accepted

0 votes
Answer accepted
Jeff Thomas Atlassian Team Oct 10, 2013

I turned on SSH in Stash and used that instead of HTTP, it's now working.

Suggest an answer

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

Master the art of thinking big, working small: A conversation with John Cutler

Hello all! It has been 20 years since the agile manifesto was introduced, and closer to 40 years since software development began moving away from a waterfall-type approach. While many teams have ...

1,413 views 11 27
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