Hello,
I am planning to use Jenkins for one of our requirements. The source code is located on Bitbucket. Here are the main steps that I did to setup build server. Note that we have Windows 2012 R2 edition, where this build server is being setup.
Installed Java 8
Installed Git - Version 2.11.0.windows.3
Installed Jenkins - Version 2.32.1
After login into Jenkins, Git path is set as "E:\Programs\Git\cmd\Git.exe". (This setting is done at Manage Jenkins → Global Tool Configuration)
We are using 'Freestyle project' in Jenkins. The project is configured to use Git as SCM (in Source Code Management section). The repository url is set to correct bitbucket private repository. Note that we are using https here (not ssh). The credentials are provided from 'Jenkins Credential Provider'.
Now, if I run the build then somehow all the time I get timeout error. Note that I have tried using different Git version (one in Git\cmd folder and one in Git\bin folder, but no luck)
The console/error log is:
Started by user gituser
Building in workspace E:\Programs\Jenkins\workspace\myproject\production
Cloning the remote Git repository
Using shallow clone
Avoid fetching tags
> E:\Programs\Git\cmd\git.exe init E:\Programs\Jenkins\workspace\myproject\Production # timeout=10
> E:\Programs\Git\cmd\git.exe --version # timeout=10
using GIT_ASKPASS to set credentials Bitbucket
ERROR: Timeout after 30 minutes
ERROR: Error cloning remote repo 'origin'
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1784)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1513)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:512)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1054)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
ERROR: null
Finished: FAILURE
In above error, there is "returned status code -1" - I am not sure what it is.
I also tried increasing timeout to 1 hour but still didn't work.
The command to fetch repo works from direct command line (and gets the objects in less than 5 minutes).
Surprisingly if I provide wrong credentials in Jenkins credential manager for this operation then also same error keeps on appearing.
I am not sure what to do next now.... please please help to fix this. I am really looking for solution here.
Thanks in advance,
Bhavnik