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

Jenkins Unable to Clone Stash Repository

Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 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

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2013

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

TAGS
AUG Leaders

Atlassian Community Events