Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Blocker
-
Resolution: Fixed
-
Component/s: git-client-plugin
-
Labels:None
-
Environment:Windows Server 2008 64 Bit
-
Similar Issues:
Description
Several problems appeared with git credentials temp file and local config after updating git-client-plugin to 1.5 using URL credentials and/or Jenkins credential store.
URL variant:
Baue auf Master in workspace D:\Jenkins\jobs\Test\workspace
Fetching changes from the remote Git repository
Fetching upstream changes from http://user@host/git.git
FATAL: Failed to fetch from http://user@host/git.git
hudson.plugins.git.GitException: Failed to fetch from http://user@host/git.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:612)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:836)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:561)
at hudson.model.Run.execute(Run.java:1678)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress http://user@host/git.git +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: error: unknown option `store=D:Tomcat-Tempgit2760255774910937069.credentials'
usage: git credential-store [options] <action>
--file <path> fetch and store credentials in <path>
error: unknown option `store=D:Tomcat-Tempgit2760255774910937069.credentials'
usage: git credential-store [options] <action>
--file <path> fetch and store credentials in <path>
fatal: Authentication failed for 'http://user@host/git.git/'
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1098)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:984)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:68)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:217)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:223)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:610)
... 10 more
Jenkins credential store variant:
Baue auf Master in workspace D:\Jenkins\jobs\Test\workspace
Fetching changes from the remote Git repository
Fetching upstream changes from http://user@host/git.git
using .gitcredentials to set credentials
FATAL: Failed to fetch from http://user@host/git.git
hudson.plugins.git.GitException: Failed to fetch from http://user@host/git.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:612)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:836)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:561)
at hudson.model.Run.execute(Run.java:1678)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: hudson.plugins.git.GitException: Command "git config --local --remove-section credential.helper" returned status code 128:
stdout:
stderr: fatal: No such section!
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1098)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1075)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:930)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:993)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:68)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:217)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:223)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:610)
... 10 more
Attachments
Activity
I believe I'm seeing the same problem (or a related problem) on Windows 2003 systems using Jenkins's credential-storing, once I updated the git-client plugin to 1.5.0. (A .gitcredentials file is mentioned in the error message, but there's no such file on the machine that I know of.)
Cloning the remote Git repository
Cloning repository https://github.com/merchantwarehouse/merchantware.git
Fetching upstream changes from https://github.com/merchantwarehouse/merchantware.git
using .gitcredentials to set credentials
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git config --local --remove-section credential.helper" returned status code 128:
stdout:
stderr: fatal: No such section!
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1098)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1075)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:930)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:993)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:68)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:217)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:349)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:828)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:561)
at hudson.model.Run.execute(Run.java:1678)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
ERROR: null
A proposed fix here:
The git syntax to remove the credentials is incorrect. It should be:
git config --local --unset credential.helper
However, in my case, the finally block with the incorrect command was just masking the true error. With emanuelez's fix in place I now get the same error as the first stack trace i.e.:
stdout:
stderr: error: unknown option `store=C:WindowsTEMPgit5425335305109688552.credentials'
usage: git credential-store [options] <action>
--file <path> fetch and store credentials in <path>
I think the correct syntax should be 'file=C:\Windows\TEMP\git5425335305109688552.credentials' instead. Fixing all of that doesn't help me though as the credentials file is missing the password!
Well spotted Peter. Now I also use --unset in the pull request.
I can't really see how File.createTempFile("git", ".credentials").getAbsolutePath() can produce a string with no slashes...
Code changed in jenkins
User: Nicolas De loof
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/016d43af6990a57b0e69e7c23e56da7ee093b82b
Log:
Merge pull request #44 from emanuelez/fixgitcredentials
JENKINS-21016 Check for exceptions thrown in finally while deleting gitcredentials
Compare: https://github.com/jenkinsci/git-client-plugin/compare/bf641cee8e06...016d43af6990
Fix for incorrect syntax in the store command and also to write the password to the temporary credentials file:
Code changed in jenkins
User: Peter Phillips
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/fa5b79e059e7dee6cd6633a4a6ebf7098be8b4a0
Log:
JENKINS-21016 fix git credentials so that password is included in file and correct syntax of store command
Code changed in jenkins
User: Peter Phillips
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/a301ee341de5b6ec98cc01173acff7f2c1812e7d
Log:
JENKINS-21016 do not actually need to replace path with forward slashes, so revert. More importantly need the credentials on a single line so that the git command can read successfully
Compare: https://github.com/jenkinsci/git-client-plugin/compare/bb904844edd0...a301ee341de5
Code changed in jenkins
User: Peter Phillips
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/e21e44ccd1446ae24fac492c71ec4aae004110bb
Log:
JENKINS-21016 fix git credentials so that password is included in file and correct syntax of store command
Code changed in jenkins
User: Peter Phillips
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/b63b7d8fe11c2c7e1acd87405ddfdf3ae96e05d0
Log:
JENKINS-21016 do not actually need to replace path with forward slashes, so revert. More importantly need the credentials on a single line so that the git command can read successfully
Code changed in jenkins
User: Peter Phillips
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/151bd0373ff93fe246cbb48a0c82c7cbe8e48509
Log:
JENKINS-21016 ensure that credential section is removed otherwise end up with multiple [credential] sections, or worse, multiple credential.helper rows
Code changed in jenkins
User: Peter Phillips
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/43c83d78d2a678a2d671339d5c01961b5d49104a
Log:
JENKINS-21016 the section is called credential rather than credential helper. Remove the whole section as using unset to remove credential.helper caused a new credential section to appear on the next set
Code changed in jenkins
User: Nicolas De loof
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/79c0e19d01da2a07c015ff9d46a7425569bc4ff0
Log:
Merge pull request #47 from pphillips-techphob/master
JENKINS-21016 Remove credential section as helper is a property within the credential section.
Compare: https://github.com/jenkinsci/git-client-plugin/compare/3a9eddbf310d...79c0e19d01da
Any estimate on time for a release with this fix? Our build system is currently down due to this.
Yes, a release date estimate would be nice. Our build system is down too due to this bug.
I encountered related issue on Linux and Mac OS X with Atlassian Stash 2.10.0 repos(via https).
I fixed this problem on my branch and tested.
It works for me.
https://github.com/jenkinsci/git-client-plugin/pull/50
- CentOS 6.4, git 1.8.5.2 and Jenkins 1.544
- Mac OS X 10.9, git 1.8.3.4 (Apple Git-47) and Jenkins 1.544
Sorry, I could not test on Windows.
Being a Jenkins noob, how do I go about applying patches to plugins? Or is it better to wait for a new release? My build system is also down and was hoping to get it up soon.
I'm fairly sure you have to rebuild from the source. I don't have a Java environment set up, so that's really difficult for me to do with any sort of speed.
I'm using a Windows system and I'll put my money where my mouth is - I'm willing to pay/donate to the dev team to get this fix released.
Maybe the hpi you can find here?
I tried that hpi but didn't work for me, I'm getting this error in Configuration -> Source Code Management -> Git -> Repository Url with Credentials:
Failed to connect to repository : Command "git config --local credential.helper store --file=\"/tmp/git3351626511932244072.credentials\"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: No such file or directory
I also get this error when attempting to build (actual repo is masked):
Started by user Marc Harter
Building in workspace /var/lib/jenkins/jobs/REDI Comps/workspace
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository https://github.com/my-company/my-project.git
Fetching upstream changes from https://github.com/my-company/my-project.git
using .gitcredentials to set credentials
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/my-company/my-project.git +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: error: cannot run /bin/echo : No such file or directory
fatal: could not read Username for 'https://github.com': No such device or address
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1103)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:985)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:69)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:218)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:350)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:828)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:561)
at hudson.model.Run.execute(Run.java:1678)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
ERROR: null
I had same error too.
I think git cannot read credential temp file(/tmp/git3351626511932244072.credentials) in.git/config.
fatal: could not read Username for 'https://github.com': No such device or address
I have made a couple of additional changes that fixed it for me:
1. line 1091 - change
environment.put("GIT_ASKPASS", launcher.isUnix() ? "/bin/echo " : "echo ");
to
environment.put("GIT_ASKPASS", launcher.isUnix() ? "/bin/echo" : "echo ");
2. line 981 - remove all the quoting:
launchCommandIn(workDir, "config", "--local", "credential.helper", "store --file=" + store.getAbsolutePath());
I'm guessing that this will screw up Windows users, so needs more work.
If it is of any help. The latest build hpi works for me:
Yes, tried that, with no luck.
The latest build hpi works for me:
That's good news.
By the way, do you use SCM polling?
build#198 works fine, but polling fails still.
I did notice GitHub Hooks was still failing (I'm assuming that relates to SCM polling?)... here is a log:
Last GitHub Push
Started on Dec 31, 2013 4:37:09 PM
Using strategy: Default
[poll] Last Built Revision: Revision d4ec38792d2ee20e8729426beeefcfd7a35ec0d8 (origin/master)
using .gitcredentials to set credentials
Could not remove the credential section from the git configuration
FATAL: hudson.plugins.git.GitException: Command "git config --local credential.helper store --file="/tmp/git786846452187017453.credentials"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: No such file or directory
hudson.util.IOException2: hudson.plugins.git.GitException: Command "git config --local credential.helper store --file="/tmp/git786846452187017453.credentials"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: No such file or directory
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:458)
at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
at hudson.scm.SCM.poll(SCM.java:373)
at hudson.model.AbstractProject._poll(AbstractProject.java:1584)
at hudson.model.AbstractProject.poll(AbstractProject.java:1493)
at com.cloudbees.jenkins.GitHubPushTrigger$1.runPolling(GitHubPushTrigger.java:73)
at com.cloudbees.jenkins.GitHubPushTrigger$1.run(GitHubPushTrigger.java:98)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:701)
Caused by: hudson.plugins.git.GitException: Command "git config --local credential.helper store --file="/tmp/git786846452187017453.credentials"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: No such file or directory
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1103)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1080)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:931)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:981)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:939)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:1451)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:488)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:456)
... 13 more
Done. Took 0.89 sec
No changes
I can confirm that the Takayuki Hirota pull request breaks the git client on windows. The back slashes are required otherwise the config file ends up with the wrong path to the credentials file.
However both Configure and Git Polling are still broken (both with status code 255) on Windows. I think this is because there is no git checkout directory with which to run the git config --local command. Normally a ls-remote shouldn't require one, but we are trying to store the credentials in the 'local' file, which stores the configuration in the repository specific configuration file (see config documentation).
One alternative would be to store the credentials in the global configuration instead, but that would seem to break the point of the JENKINS-20318 development in that multiple executors couldn't the connect to the same repository using different credentials.
The other approach would be to ensure that we always run a command within a initialised repository directory (i.e. git init has been run first). I've tried changing the getHeadRev within CliGitAPIImpl.java to pass in the current workspace, but that didn't work as the workspace was set to null during the Git Polling. I'm not sure at what stage the Jenkins workspace is created. For Configure to work, when the user selects Git as the SCM and chooses the credentials we will then need to do a git init before running the first git config command.
For now, I've hacked my local copy of the plugin to run in global mode, which works for me as I don't need to access a repository with different credentials under different circumstances. See https://github.com/pphillips-techphob/git-client-plugin for that version instead.
I think I'm having the same issue:
"Started by user anonymous
Building remotely on Windows_vs100_slave in workspace c:\h\workspace\mxfSPEEDRAIL_GIT
Fetching changes from 2 remote Git repositories
Fetching upstream changes from ssh://git@host/opt/git/common/mde.git
ERROR: Timeout after 10 minutes
FATAL: Failed to fetch from ssh://git@host/opt/git/common/mde.git
hudson.plugins.git.GitException: Failed to fetch from ssh://git@host/opt/git/common/mde.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:612)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:836)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
at hudson.model.Run.execute(Run.java:1665)
at hudson.matrix.MatrixBuild.run(MatrixBuild.java:304)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:246)
at hudson.model.OneOffExecutor.run(OneOffExecutor.java:66)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@host/opt/git/common/mde.git +refs/heads/master:refs/remotes/origin/master" returned status code -1:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1099)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:985)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:69)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:218)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:224)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Unknown Source)"
This is definitely an issue.
I have tried updating the plugin with no luck.
As a temporary workaround under Windows, I am foregoing using any source control plug-in and instead just using a Windows Command build step to do all of the Git access. It's not ideal and I'd love to see this fixed, but I'm not a Java developer and I had to move forward. Here are more details on what I did:
http://blog.opennetcf.com/2014/01/08/using-jenkins-to-build-from-git-without-the-git-plug-in/
It is working on one of our server (git plugin 2.0.1-SNAPSHOT (private-01/07/2014 17:37) and git-client 1.6.1-SNAPSHOT (private-01/07/2014 17:31))
but failing on another one (git plugin 2.0.1 and git-client 1.6.1-SNAPSHOT (private-01/07/2014 17:31)).
Fetching changes from the remote Git repository
Fetching upstream changes from https://git.foooooooo.com/git/PROJECT/connect.git
using .gitcredentials to set credentials
FATAL: Failed to fetch from https://git.foooooooo.com/git/PROJECT/connect.git
hudson.plugins.git.GitException: Failed to fetch from https://git.foooooooo.com/git/PROJECT/connect.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:625)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:847)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:872)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
at hudson.model.Run.execute(Run.java:1665)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:246)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://git.foooooooo.com/git/PROJECT/connect.git +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: error: cannot run /bin/echo : No such file or directory
fatal: could not read Username for 'https://git.foooooooo.com': No such device or address
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1109)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:991)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:220)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
I don't understand, why the problem is? What could be the difference?
Servers and agents are Linux.
IMO the priority should be set to blocker due to its nature.
Is it also normal for the workspace to only have a .git dir (not the files and folders)?
New problem showing:
Started by user Pedro Reis
Building remotely on Windows_vs100_slave in workspace c:\h\workspace\GIT_test
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://git@host/opt/git/common/mde.git
FATAL: Failed to fetch from ssh://git@host/opt/git/common/mde.git
hudson.plugins.git.GitException: Failed to fetch from ssh://git@host/opt/git/common/mde.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:625)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:847)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:872)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
at hudson.model.Run.execute(Run.java:1665)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:246)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://git@host/opt/git/common/mde.git +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1099)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:985)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:69)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:218)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Unknown Source)
It seems this problem occurs also using windows batch at Jenkins v1.532.1. If I run this batch locally, the problem doesn't occur!:
Started by user Pedro Reis
Building remotely on Windows_vs100_slave in workspace c:\h\workspace\GIT_test
[GIT_test] $ cmd /c call C:\DOCUME~1\user\LOCALS~1\Temp\hudson3319679789711969196.bat
c:\h\workspace\GIT_test>REM make sure nothing is hidden
c:\h\workspace\GIT_test>attrib -H /S
File not found - C:\h\workspace\GIT_test*.*
c:\h\workspace\GIT_test>REM recursively remove child folders
c:\h\workspace\GIT_test>REM for /d %X in (.) do rd /s /q "%X"
c:\h\workspace\GIT_test>REM delete files in root folder
c:\h\workspace\GIT_test>REM del /q /f *
c:\h\workspace\GIT_test>REM get the source
c:\h\workspace\GIT_test>git clone ssh://git@host/opt/git/common/mde.git
Cloning into 'mde'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
c:\h\workspace\GIT_test>exit 128
Hi!
I upgraded to latest Jenkins version and to the latest version of Git client plugin i.e. 1.6.1; no luck.
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building in workspace /apps/ci/.jenkins/home/jobs/CI-Test/workspace
Fetching changes from the remote Git repository
Fetching upstream changes from https://github.com/mycompany/mygitrepo.git
using .gitcredentials to set credentials
FATAL: Failed to fetch from https://github.com/mycompany/mygitrepo.git
hudson.plugins.git.GitException: Failed to fetch from https://github.com/mycompany/mygitrepo.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:625)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:847)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:872)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1415)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:561)
at hudson.model.Run.execute(Run.java:1678)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/mycompany/mygitrepo.git +refs/heads/master:refs/remotes/origin/master" returned status code 128:
stdout:
stderr: error: cannot run /bin/echo : No such file or directory
fatal: could not read Username for 'https://github.com': Input/output error
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1086)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:968)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:197)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:623)
... 10 more
I request we make this a blocker considering the fact we cannot proceed with builds at all so long this issue exists.
I am experiencing the same problem when setting up a build plan on Jenkins using git.
I have Jenkins installed on an EC2 instance.
Failed to connect to repository : Command "git config --local credential.helper store --file=\"/tmp/git1036220241480036003.credentials\"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: No such file or directory
Polling is also broken.
I'm sure the developers would appreciate more clues than "Polling is also broken" !
There are solutions to these problems in the thread. This is an open source project. Perhaps you could try and provide answers. It's really not that hard to build the plugin and fix it yourself.
> I'm sure the developers would appreciate more clues than "Polling is also broken" !
Actually I would like to see, whether the developers are able to reproduce these issues.
> There are solutions to these problems in the thread. This is an open source project. Perhaps you could try and provide answers. It's really not that hard to build the plugin and fix it yourself.
If I was able to fix, I would certainly do.
I don't see any solution in this thread.
Here is a summary:
git (client) plugin doesn't work with http(s) based repositories. Polling also seems to be broken. There are various error messages, they probably depend on the system and environment.
Eg.
- setting up the repository on the job configuration page:
Failed to connect to repository : Command "git config --local credential.helper store --file=\"/tmp/git3436741386766728464.credentials\"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: No such file or directory
- build a job manually:
Fetching changes from the remote Git repository
Fetching upstream changes from https://git.fooodomain.com/git/baaaaaar/connect.git
using .gitcredentials to set credentials
FATAL: Failed to fetch from https://git.fooodomain.com/git/baaaaaar/connect.git
hudson.plugins.git.GitException: Failed to fetch from https://git.fooodomain.com/git/baaaaaar/connect.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:625)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:847)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:872)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:561)
at hudson.model.Run.execute(Run.java:1678)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://git.fooodomain.com/git/baaaaaar/connect.git +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: error: cannot run /bin/echo : No such file or directory
fatal: could not read Username for 'https://git.fooodomain.com': No such device or address
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1109)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:991)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:220)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
It's easy to reproduce:
- get the latest version of jenkins and git/git client plugins
- setup a central credential for the git server
- setup a job with https repository URL
- run a build and check the console output
search for my name above and you see fixes for both of these errors.
I thought that changes were already applied.
Thanks, I'll try it.
Not everyone has the experience, nor time to troubleshoot this issue on their own. I personally have spent the past 2 weeks trying to resolve this issue without any success.
Adrian Smith, I have seen your fix above, but what worries me is that you mention that you guess it'll break on Windows systems. Unfortunately, this is what keeps me from applying this fix myself.
Understandably, this is an open source project, but there are far more talented developers with experience in the entire stack that can apply a more reliable fix.
yes, point taken. There is probably some middle ground. One of the benefits of Open Source is that ultimately you can fix it yourself. You can raise the priority all you like, but it's just best efforts from other enthusiastic people that gets us fantastic products like Jenkins that are free!
Thanks, Adrian Smith.
I have got this issue on Linux server and replacing "/bin/echo " with "/bin/echo" helps me.
Replacing "/bin/echo " works for me to but only for builds thats only checking out project.
I stil have mesage in build configuration:
Failed to connect to repository : Command "git config --local --remove-section credential.helper" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config
And problem with Git publisher and Pushing results after successful build.
Pushing HEAD to branch fix of origin repository
ERROR: Failed to push merge to origin repository
hudson.plugins.git.GitException: Failed to connect to https://xxx.repo.org/project.git (status = 401)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:1601)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:952)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.push(CliGitAPIImpl.java:1109)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.push(CliGitAPIImpl.java:1121)
at hudson.plugins.git.GitAPI.push(GitAPI.java:65)
at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:226)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706)
at hudson.model.Run.execute(Run.java:1703)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
stderr: error: could not lock config file .git/config
I have this message too. But only at the configuration page. I think the cause is that current directory is not the workspace of a project, so git cannot find ".git/config" file.
Further to my previous comment:
The git configuration page runs 'git config --local', which will always require a workspace, but one doesn't exist (or hasn't been initialised at that point). That is why polling doesn't work too, as there is no workspace then either.
We could go down the route of requiring an initialised workspace, but that seems like a backwards step as the git client was recently changed to do a ls-remote and therefore not to require a workspace (e.g. see JENKINS-10131).
I've created a fork with the config set to system too - see https://github.com/pphillips-techphob/git-client-plugin/tree/config-system. I found that the Windows user that Jenkins is running as doesn't have a user home directory so therefore required that the configuration be stored in git home instead.
Code changed in jenkins
User: Nicolas De loof
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/7835f8c67f57a5e34dff0347b2667d7348cfc6df
Log:
Merge pull request #67 from anadimisra/master
JENKINS-21016: removed whitespace from /bin/echo argument
Compare: https://github.com/jenkinsci/git-client-plugin/compare/f759bca7872a...7835f8c67f57
Using v. 1.6.1, you can get polling to work by setting the "Force polling using workspace" option.
I have submitted https://github.com/jenkinsci/git-client-plugin/pull/71 to handle correctly escaping on windows/linux.
However during testing, I found that if tmpdir on windows use short names (like C:\DOCUME~1\$NCEOC~1\LOCALS~1\Temp), it doesn't work when set through credential helper.
Still push does not work
Fetching changes from the remote Git repository
Fetching upstream changes from https://git.example.org/root/project.git
using .gitcredentials to set credentials
Merging Revision c898d6c0696f0734b348e3e574fd2131bfb48912 (origin/master) onto origin/fix using default strategy
Seen branch in repository origin/HEAD
Seen branch in repository origin/maste
Seen branch in repository origin/fix
Seen 3 remote branches
Checking out Revision f411051b3aaa544ee16df8510272804748a9e8cd ()
First time build. Skipping changelog.
No emails were triggered.
Pushing HEAD to branch fix of origin repository
ERROR: Failed to push merge to origin repository
hudson.plugins.git.GitException: Failed to connect to https://git.example.org/root/project.git (status = 401)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:1590)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:952)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.push(CliGitAPIImpl.java:1098)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.push(CliGitAPIImpl.java:1110)
at hudson.plugins.git.GitAPI.push(GitAPI.java:65)
at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:226)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706)
at hudson.model.Run.execute(Run.java:1703)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Build step 'Git Publisher' marked build as failure
Code changed in jenkins
User: Vincent LATOMBE
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/76ed552280416b54204214457a0a0fa95e4d81ac
Log:
JENKINS-21016 On windows, escape the path to the file store, on unix
don't.
Code changed in jenkins
User: Nicolas De loof
Path:
src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
http://jenkins-ci.org/commit/git-client-plugin/4354154a5192ca53c32771729a2bf11a28b34cdb
Log:
Merge pull request #71 from Vlatombe/JENKINS-21016
JENKINS-21016 On windows, escape the path to the file store, on unix don't
Compare: https://github.com/jenkinsci/git-client-plugin/compare/69cb9f8764fe...4354154a5192
Looks like this missed the 1.548 (2014/01/20) release (according to the release notes). Any chance this will get into the next release?
Confirmed that "Force polling using workspace" fixes the issue for me. Thanks.
@Gabriel Guzman thanks for your workaround... its worked for me too...
This fixes a workDir issue on unix systems: https://github.com/jenkinsci/git-client-plugin/pull/90
Works for me.
I also have to create a dummy/empty .git/config file in jenkins user's home (/var/lib/jenkins).
To resume, the issue is : running git commands with credentials require a working directory, but polling without workspace by design don't have workspace to act as such a directory. Could maybe use a temp directory for this purpose.
Agreed, but the temp directory needs to have a .git/config file too. This can be achieved by either running git init in that directory, or it sound like creating an empty .git/config file will work too.
The problem is upon configuring a job using an HTTP-based URL with Git credentials, the plug-in attempts to do form validation and verify whether the HTTP authentication succeeded. Because of the recent updates to store this info as a temporary store so that subsequent Git commands will succeed with these credentials, the validation can fail in the absence of a workspace directory.
In other words, the warning message "Failed to connect to repository : Command "git config --local credential.helper store" appears and can be ignored, but it's a false alarm. The job will fetch correctly if ran.
For instance, if Jenkins was started from the / dir, then git will attempt to access .git/config from the root directory, resulting in permissions denied.
Should the creation of the local credential simply just not be done in the absence of a workspace directory? See:
Hi,
about the error: Failed to connect to repository : Command "git config --local credential.helper store --file=\"C:\Windows\TEMP\git2188577699663987074.credentials\""
I think the git command that is attempted by the url validator is incorrect in two points:
-it uses both --local and --file, which are exclusive: --local tells to store in .git/config, --file tells store in the specified file.
-It sets the --file argument at the end of the command line. At least on my git client (cygwin-git, v1.7.9) it is required that the --file comes right after git config.
e.g. If I manually type the following on the command line, it works perfectly:
git config --file="C:\Windows\TEMP\git2188577699663987074.credentials" credential.helper store
I suppose this is the intention of the original command, isn't it ?
Hi Sébastien,
That is not the intention of the original command. We use the --local to indicate that git should use the local store (i.e. the workspace directory) and then that the credential helper should use the file specified as the store. Note that the manual page (http://git-scm.com/docs/git-credential-store.html) is incorrect in that it states the options of the store command is --store=<path>. It is in fact --file=<path> (see my first comment on this issue) and also my pull request (https://github.com/jenkinsci/git-client-plugin/pull/45)
Added PR https://github.com/jenkinsci/git-client-plugin/pull/100 to try to create this temporary workspace directory. Can we just use the same dir used to create the temporary workspace dir?
Confirmed resolved in git-client-plugin 1.6.2
Fix released in git-client-plugin 1.6.2
I'm still seeing this issue with git client plug-in 1.8.0. Here's the specific message:
Started on Apr 14, 2014 12:00:10 PM
Using strategy: Default
[poll] Last Built Revision: Revision e28681748de2b634ab6cd68c55dc0ac349e6b872 (origin/master)
using .gitcredentials to set credentials
Could not remove the credential section from the git configuration
FATAL: Command "git config --local credential.helper store --file=\"C:\Users\IDTASK~1\AppData\Local\Temp\git4905599288427248808.credentials\"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: File exists
hudson.util.IOException2: Command "git config --local credential.helper store --file=\"C:\Users\IDTASK~1\AppData\Local\Temp\git4905599288427248808.credentials\"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: File exists
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:459)
at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
at hudson.scm.SCM.poll(SCM.java:373)
at hudson.model.AbstractProject._poll(AbstractProject.java:1567)
at hudson.model.AbstractProject.poll(AbstractProject.java:1490)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: hudson.plugins.git.GitException: Command "git config --local credential.helper store --file=\"C:\Users\IDTASK~1\AppData\Local\Temp\git4905599288427248808.credentials\"" returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: File exists
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1276)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1253)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1249)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1245)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1142)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1091)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1082)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:1739)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:492)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:457)
... 13 more
Done. Took 13 sec
No changes
David Humeniuk I believe that stack trace is different than the other stack traces reported in this bug report. It seems to be similar to the stack trace in JENKINS-21914. In both cases, the problem is visible on Windows.
Can you confirm that there are no "orphan" git.exe processes running on the machine which shows the problem?
If there are orphan git processes, can you kill them and see if that resolves your issue?
I'll report my status on the other issue since that seems to be more appropriate. Thanks.
Hello,
Same issue on Debian Linux Wheezy with a git repository hosted by SCM Manager.
This was the first time I set up a job with git.
My home config (~/.git/config) was blank.
May be making this command fail safe would be enough ?