1

We have installed a Git server and Jenkins (git plugin). The install succeed. But when we configured a job for a build on Jenkins we had the following problem :

Started by user admin
[EnvInject] - Loading node environment variables.
Building in workspace C:\Program Files (x86)\Jenkins\jobs\HSH\workspace
> C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
Fetching changes from the remote Git repository
> C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url http://localhost/Bonobo.Git.Server/HomeScreenHome.git
Fetching upstream changes from http://localhost/Bonobo.Git.Server/HomeScreenHome.git
> C:\Program Files (x86)\Git\bin\git.exe --version
FATAL: Failed to fetch from http://localhost/Bonobo.Git.Server/HomeScreenHome.git
hudson.plugins.git.GitException: Failed to fetch from http://localhost/Bonobo.Git.Server/HomeScreenHome.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:622)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:854)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:879)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1254)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530)
    at hudson.model.Run.execute(Run.java:1732)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)
Caused by: hudson.plugins.git.GitException: Failed to connect to http://localhost/Bonobo.Git.Server/HomeScreenHome.git using credentials  (status = 502)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:2111)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1151)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:87)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:265)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:620)
... 10 more

We have a git server configured with credentials and Http Url localhost/Bonobo.Git.Server/HomeScreenHome.git. We have configured the Jenkins Git plugin with the Git repository url and credentials relative to the repo.

We don't know why we have a 502 status error, and why git clone and git fetch works using git only.

Stefan Crain
  • 2,010
  • 3
  • 21
  • 22
Guillaume
  • 13
  • 1
  • 1
  • 5

1 Answers1

0
  1. If it's on localhost, couldn't you simply use file:///...?
  2. Jenkins will probably run under a different user, so doing a clone with your normal user doesn't say much about what Jenkins can do. You'll need to add the proper credentials under Manage Jenkins -> Configure System
xeraa
  • 10,456
  • 3
  • 33
  • 66