Já publiquei esta questão:
O Jenkins não pode ler a senha do Github desde a atualização para o plugin do Git 2.1.0
Resumidamente, eu clonei minha instância de produção do Jenkins 1.650 e atualizei a instância clonada para 2.25 no Windows 2012.
Como parte disso, o plugin Git Client foi atualizado de 1.19.6 para 2.1.0 e agora ele não pode autenticar.
Eu tenho trabalhos que funcionam perfeitamente se eu fizer downgrade desse plug-in novamente, mas quando executados usando o plug-in atualizado, os trabalhos falharão.
Agora percebi que a única diferença que posso ver é que na saída da tarefa, na instância em que ela funciona, há uma mensagem using .gitcredentials to set credentials
e na instância clonada using GIT_ASKPASS to set credentials
.
Eu suspeito que esse seja o problema ou pelo menos relacionado, mas não consigo encontrar uma maneira de mudar isso. Saída completa de trabalhos com falha abaixo:
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://[email protected]': 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
EDITAR
De acordo com as sugestões do bobs, executei esses comandos com sucesso.
del c:\users\user-name\.gitconfig
git config --global credential.helper manager
git fetch --tags --progress https://stash/myproj/proj.git +refs/heads/*:refs/remotes/origin/*
No entanto, a saída ao executar meu trabalho era exatamente a mesma. Ainda usando o GIT_ASKPASS. Deve haver uma maneira de reverter para .gitcredentials.