Question

I'm using the Git Client plugin to connect Jenkins to my repository (in theory). I'm not able to connect to repo using basic HTTP authentication. When I enter the username:password manually I'm able to connect. I've tried a number of different ways to connect and nothing seems to work as expected. If I turn off my HTTP authentication Jenkins successfully connects and builds without issue. I'm using...

  • Credentials 1.10
  • Jenkins Git Client plugin 1.6.3
  • Jenkins Git plugin 2.0.3
  • Apache, Git 1.7.1 on server

If I try to set the path in the job configuration via something like http://username:password@git.mydomain.com it seems to autocheck the validaty of the path and does not complain. However, using this method when I actually build the job my server reports a password mismatch error (it shows the username but not the password in the error, I'm assuming a password is actually used though I'd love to know for sure). Here is the error in the Apache error_log:

user jenkins: authentication failure for "/info/refs": Password Mismatch

if I enter the same credentials in the credentials box it does not connect and spits out:

Failed to connect to repository : Command "git config --local credential.helper store --file=/var/lib/jenkins/tmp/git4177869325176518383.credentials" returned status code 129:
stdout: 
stderr: error: unknown option `local'
usage: git config [options]

I don't see --local in the git manual, perhaps there is a module I need?

Was it helpful?

Solution

I had the same problem. The issue is that the Jenkins Git plugin expects to have git version 1.8 or higher installed on the Jenkins server - but doesn't check that or warn you that you're using an out-of-date release. (git 1.8 supports a --local option to be specified for git config; git 1.7 doesn't.)

There are a number of options available to you to workaround this:

  1. Update the version of git installed on your server.
  2. Have Jenkins download git upon demand, and use that version for building your projects. (This takes quite a bit of configuration.) This option does not use the copy of git installed on your server.
  3. Have Jenkins use JGit (pure Java version of git which does not require git to be installed on your server) - this uses the JGit that comes with the Jenkins Git Client, so far as I can tell.

Options 2 & 3 are available through the Add Git button on the Manage Jenkins/Configure System page in the Git/Git installations section.

My server runs Ubuntu 10.4 LTS, for which there is no git 1.8 package available in the standard repositories, and I prefer not to install non-packaged software on my server, so that ruled out option 1 for me. I found the configuration for option 2 to be too onerous, and didn't give me a warm feeling that it would continue to work for new git releases. So that left me with option 3, which has been working OK for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top