jenkins - Jenkins 服务帐户无法从 Git 中提取
问题描述
我遇到了一些从 Jenkins 随机开始的麻烦。我们所有的工作都开始失败,看起来我们用来运行工作的服务帐户存在凭据问题。这是随机开始的。我已经尝试更新 Jenkins 和插件的版本,但没有任何变化。这是我们在任何运行的作业中收到的输出:
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://site.visualstudio.com/_git/prodscripts # timeout=10
Fetching upstream changes from https://site.visualstudio.com/_git/prodscripts
> git.exe --version # timeout=10
using GIT_ASKPASS to set credentials site git repo
> git.exe fetch --tags --progress https://site.visualstudio.com/_git/prodscripts +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://site.visualstudio.com/_git/prodscripts
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:888)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1155)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
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:1810)
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 "git.exe fetch --tags --progress https://site.visualstudio.com/_git/prodscripts +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: Logon failed, use ctrl+c to cancel basic credential prompt.
fatal: Authentication failed for 'https://site.visualstudio.com/_git/prodscripts/'
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:886)
... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
我还确认该服务帐户可以毫无问题地登录到我们的 git 存储库,并确认该帐户的安全权限。我完全不知道詹金斯是如何运作的,并且从别人那里继承了詹金斯,所以我很难找出问题所在。任何帮助将不胜感激。
编辑:我还想补充一点,当我尝试查看作业配置时,我收到以下信息:
解决方案
请确保您使用的是正确的凭据,如果最近发生了更改,请不要忘记在 Jenkins 凭据管理器中更新它。我遇到了类似的问题,但是当我更新密码时 - 它解决了。
推荐阅读
- c++ - C ++ Builder中的未知类型名称“Shape1”
- swift - 线程 1:由于 Button 导致的信号 SIGABRT 错误
- lambda - 用 α 减少的 lambda 演算减少
- java - 在 Maven 插件中使用属性文件中的变量
- python - 在 Python 中构建具有交叉验证的线性回归模型
- function - 如何创建一个将其所有参数传递给另一个函数的函数
- vue.js - 将路由器参数传递给组件对象
- perl - 有人可以向我解释这个循环吗?
- vb.net - 计算从银行账户取款的次数
- javascript - 将值从我的 .click() 函数传递到 if 语句