如何将Jenkins Git插件从使用Git_ASKPASS更改为.Git凭据

如何将Jenkins Git插件从使用Git_ASKPASS更改为.Git凭据,git,jenkins,Git,Jenkins,如何将Jenkins Git插件从使用Git_ASKPASS更改为.Git凭据 我已经发布了这个问题: 简而言之,我已经克隆了Jenkins 1.650的生产实例,并在Windows 2012上将克隆的实例升级到2.25 作为其中的一部分,Git客户端插件从1.19.6升级到了2.1.0,现在它无法进行身份验证 如果我再次降级这个插件,我的作业运行得很好,但是当使用升级的插件运行它们时,作业失败了 我现在注意到,我可以看到的一个区别是,在作业输出中,在它工作的实例上,有一条消息使用.gitcr

如何将Jenkins Git插件从使用Git_ASKPASS更改为.Git凭据

我已经发布了这个问题:

简而言之,我已经克隆了Jenkins 1.650的生产实例,并在Windows 2012上将克隆的实例升级到2.25

作为其中的一部分,Git客户端插件从1.19.6升级到了2.1.0,现在它无法进行身份验证

如果我再次降级这个插件,我的作业运行得很好,但是当使用升级的插件运行它们时,作业失败了

我现在注意到,我可以看到的一个区别是,在作业输出中,在它工作的实例上,有一条消息
使用.gitcresidences设置凭据
,在克隆的实例上
使用GIT\u ASKPASS设置凭据

我怀疑这就是问题所在,或者至少与此相关,但我找不到改变这一点的方法。失败作业的完整输出如下:

08:18:40 Cloning the remote Git repository
08:18:40 Cloning repository https://github.com/mycompany/myrepo.git
08:18:40  > C:\Program Files\Git\cmd\git.exe init C:\Program Files (x86)\Jenkins\workspace\project # timeout=10
08:18:40 Fetching upstream changes from https://github.com/mycompany/myrepo.git
08:18:40  > C:\Program Files\Git\cmd\git.exe --version # timeout=10
08:18:40 using GIT_ASKPASS to set credentials 
08:18:40  > C:\Program Files\Git\cmd\git.exe fetch --tags --progress https://github.com/mycompany/myrepo.git +refs/heads/*:refs/remotes/origin/*
08:18:41 ERROR: Error cloning remote repo 'origin'
08:18:41 hudson.plugins.git.GitException: Command "C:\Program Files\Git\cmd\git.exe fetch --tags --progress https://github.com/mycompany/myrepo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
08:18:41 stdout: 
08:18:41 stderr: '*dds23' is not recognized as an internal or external command,
08:18:41 operable program or batch file.
08:18:41 error: unable to read askpass response from 'C:\Windows\TEMP\pass6274847349411211542.bat'
08:18:41 bash: /dev/tty: No such device or address
08:18:41 error: failed to execute prompt script (exit code 1)
08:18:41 fatal: could not read Password for 'https://user@github.com': No error
08:18:41 
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:512)
08:18:41    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1054)
08:18:41    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
08:18:41    at hudson.scm.SCM.checkout(SCM.java:495)
08:18:41    at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
08:18:41    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
08:18:41    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
08:18:41    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
08:18:41    at hudson.model.Run.execute(Run.java:1720)
08:18:41    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
08:18:41    at hudson.model.ResourceController.execute(ResourceController.java:98)
08:18:41    at hudson.model.Executor.run(Executor.java:401)
08:18:41 ERROR: null
08:18:41 Archiving artifacts
08:18:41 [htmlpublisher] Archiving HTML reports...
08:18:41 [htmlpublisher] Archiving at PROJECT level C:\Program Files (x86)\Jenkins\workspace\project\server.project\server.distribution\target\htmldocs\documentation to C:\Program Files (x86)\Jenkins\jobs\project\htmlreports\documentation
08:18:41 ERROR: Specified HTML directory 'C:\Program Files (x86)\Jenkins\workspace\project\server.project\server.distribution\target\htmldocs\documentation' does not exist.
08:18:41 [BFA] Scanning build for known causes...
08:18:41 [BFA] No failure causes found
08:18:41 [BFA] Done. 0s
08:18:41 Started calculate disk usage of build
08:18:41 Finished Calculation of disk usage of build in 0 seconds
08:18:41 Started calculate disk usage of workspace
08:18:41 Finished Calculation of disk usage of workspace in 0 seconds
08:18:42 Sending e-mails to: bob@yeah
08:18:43 Finished: FAILURE

这已由serverfault用户回答:

不过,简而言之,在Windows环境中,Jenkins 2+存在已知的错误,该环境中读取的密码包含需要Windows在命令提示符下转义的字符


我更改了Github帐户的密码,这解决了身份验证问题。

可能与Git Credential Manager for Windows有关吗?尝试在运行作业的计算机上卸载Git,并在没有凭据管理器的情况下重新安装(应该有取消选择的选项)尝试了该操作,但不幸的是仍然使用Git_ASKPASS。