-
Bug
-
Resolution: Unresolved
-
Major
-
None
When following kind of password was configured to Bitbucket (Crowd): Kesäalkoi123%
Jenkins agents can't make git clone etc:
Started by user XXXXXXXStarted by user XXXXXXXBuilding remotely on Windows_10 in workspace C:\Jenkins\workspace\xxxxxx > C:\Program Files\Git\mingw64\bin\git rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository > C:\Program Files\Git\mingw64\bin\git config remote.origin.url https://testi.me.fi/stash/scm/ot/xxxxxx.git # timeout=10Fetching upstream changes from https://testi.me.fi/stash/scm/ot/xxxxxx.git > C:\Program Files\Git\mingw64\bin\git --version # timeout=10using GIT_ASKPASS to set credentials > C:\Program Files\Git\mingw64\bin\git fetch --tags --progress https://testi.me.fi/stash/scm/ot/xxxxxxn.git +refs/heads/:refs/remotes/origin/*ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException: Failed to fetch from https://testi.me.fi/stash/scm/ot/xxxxxx.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160) at hudson.scm.SCM.checkout(SCM.java:504) at hudson.model.AbstractProject.checkout(AbstractProject.java:1208) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1794) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\mingw64\bin\git fetch --tags --progress https://testi.me.fi/stash/scm/ot/xxxxxxn.git +refs/heads/:refs/remotes/origin/*" returned status code 128:stdout: stderr: error: cannot spawn sh: No such file or directoryerror: cannot spawn sh: No such file or directoryfatal: Authentication failed for 'https://testi.me.fi/stash/scm/ot/xxxxxx.git/'
And everything works fine if agents are not used (Jenkins build is run locally on master)..
If you're running Jenkins 2.126 (a weekly version from two years ago), then you may also be running an outdated version of the git client plugin and git plugin. Git client plugin 3.0 and git plugin 4.0 include fixes for authentication that may resolve this issue as well. Those git plugin versions require a newer Jenkins versions than 2.126.
If you're running a newer version of Jenkins and made a typo when entering the Jenkins version, please list the version.
Please also provide the version of the git plugin and git client plugin that you are running.
You may also need to correct the PATH to command line git. The git plugin is tested with command line git 2.27.0 installed as bin/git.exe as in C:\Users\MarkE\tools\git-2.27.0\bin\git.exe. I don't test with mingw64\bin\git.exe as the command line git executable. It may work, but it is not an installation that I test.