0
votes

I'm new to Jenkins and installed it on my local windows machine.

I've installed the git plugin, and configured it together, but when trying to run build, it fails with the following exception:

Started by user anonymous Building in workspace C:\workPrograms\jenkins\jobs\server1\workspace

git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository git.exe config remote.origin.url http://mygit.com/backend/server.git # timeout=10 Fetching upstream changes from http://mygit.com/backend/server.git git.exe --version # timeout=10 git.exe -c core.askpass=true fetch --tags --progress http://mygit.com/backend/server.git +refs/heads/:refs/remotes/origin/ ERROR: Timeout after 10 minutes ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from http://mygit.com/backend/server.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097) at hudson.scm.SCM.checkout(SCM.java:485) at hudson.model.AbstractProject.checkout(AbstractProject.java:1269) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1738) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: hudson.plugins.git.GitException: Command "git.exe -c core.askpass=true fetch --tags --progress http://mygit.com/backend/server.git +refs/heads/:refs/remotes/origin/" returned status code -1: stdout: stderr: at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:808) ... 11 more ERROR: null Finished: FAILURE

running the same commands from command line works without a problem.

what am I missing here?

Aviad

2
If the same command is working on the same machine you're running on for under than 10 minutes - consider checking if you're working behind a proxy, Jenkins might not be able to access your GIT repositoryDvir669

2 Answers

1
votes

Check if there is any proxy setting done on system. Check if environment variable "http_proxy" or "https_proxy" is set. It might be the case that http_proxy environment variable it set, that's why you are able to clone/access the repository from command line.

In case proxy is set then you need to set the proxy in jenkins as well. Set http proxy on

"Jenkins -> Manage Jenkins -> Manage Plugins -> Advanced Tab".
0
votes

well cloning http://mygit.com/backend/server.git times out -- either the URL is wrong or it takes over 10m.

Since you say entering the command on the CLI works, it must be the 10m timeout. That can easily be changed in the jenkins UI by adding advanced checkout or advanced clone behaviors and defining a value for the timeout -- e.g. 30

see also: https://issues.jenkins-ci.org/browse/JENKINS-20445

for me, I had to set it to 30m once ;)