0
votes

I am working on setting up Jenkins for our Android project placed on Bitbucket repository. I am continuously getting timeout during git fetch command as part of build process. Below are the console logs.

started by user SUKHVIR SINGH

Building in workspace C:/RCJenkins Cloning the remote Git repository Cloning repository

https://[email protected]/scm//myproject.git git.exe init C:\RCJenkins # timeout=10 Fetching upstream changes from https://[email protected]/scm//myproject.git git.exe --version # timeout=10 using GIT_ASKPASS to set credentials Setting http proxy: abc.xyz.company.com:80 git.exe fetch --tags --progress https://[email protected]/scm//myproject.git +refs/heads/:refs/remotes/origin/ ERROR: Timeout after 10 minutes ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "git.exe fetch --tags --progress https://[email protected]/scm//myproject.git +refs/heads/:refs/remotes/origin/" returned status code -1: stdout: stderr: at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:352) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:559) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1075) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1115) at hudson.scm.SCM.checkout(SCM.java:495) at hudson.model.AbstractProject.checkout(AbstractProject.java:1276) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:560) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485) at hudson.model.Run.execute(Run.java:1735) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405) ERROR: Error cloning remote repo 'origin' Finished: FAILURE

What I did so far :-

1) Downloaded and installed latest stable Jenkins 2.60.2 on my local machine 2) Created admin user. 3) Created a Freestyle job. 4) Configured the job to use reposiory url "https://[email protected]/scm//myproject.git" and added repository credentials in Jenkins credentials manager.

Earlier, the workspace being used did not had right permissions on my machine and even git command line was not working. Now I have change Job configuration to use custom workspace location which have write/read permissions. I am able to execute git commands through commandline in the workspace but when I start build process through Jenkins, I get above mentioned timeout error. Below is the screenshot of my job configuration. enter image description here

1
Do you need the proxy server for this sort of traffic? It looks like everything is internal, including your Bitbucket Server instance, so depending on your network configuration you may not need to go through the proxy.Jim Redmond
I have already added the proxy details in Jenkins ->manage plugins > Advanced . I have tested the proxy in Jenkins using test connection button and it was success. Actually, I am working in company network, that's why it has proxy.Sukhvir Singh
I tried building a public repository and was able to build. Seems something related to credentials but need to figure out what.Sukhvir Singh
The proxy may not be passing your credentials to the Bitbucket instance; that's not necessary for public repos. Again, though, if you're inside the company network for the entire path, then do you really need the proxy?Jim Redmond
I have tried this without proxy using with my home network with similar results.Sukhvir Singh

1 Answers

0
votes
  1. Download and install Wireshark, to see whats going on on your network. To do so, double click your network interface/start recording, do 2., stop recording, search with "String" and "Packet bytes" for your URL and right click -> Follow -> TCP Stream.

  2. Test your exact link again. First with validate proxy, then with build.