【问题标题】:error configuring Jenkins to work with Git配置 Jenkins 以使用 Git 时出错
【发布时间】:2021-12-19 07:51:56
【问题描述】:

我正在使用 azure devops,
尝试在 jenkins 中运行构建时出现以下错误:

hudson.plugins.git.GitException: Command "git.exe fetch --tags --force --progress -- https://xxxx.com/_git/xxxx +refs/heads/*:refs/remotes/origin/*" returned status code 128:  
stdout:   
stderr:  fatal: Cannot prompt because user interactivity has been disabled.  
fatal: unable to access 'https://xxxx/_git/xxxx/': The requested URL returned error: 403   

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2681)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2102)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:86)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:624)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:853)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1224)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
at hudson.scm.SCM.checkout(SCM.java:505)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1213)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
at hudson.model.Run.execute(Run.java:1888)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:99)
at hudson.model.Executor.run(Executor.java:431)
ERROR: Error cloning remote repo 'origin'

如果我在 jenkins 中检查我的项目 - 配置:

Git SCM step error

*用户拥有所有必需的权限。
*在詹金斯工作中我使用用户名和密码方法,而在密码中我使用用户个人访问令牌。

【问题讨论】:

    标签: git jenkins azure-devops jenkins-pipeline jenkins-plugins


    【解决方案1】:

    看起来使用的凭据不正确,提示 Git 退回到请求用户名/密码,这在 Jenkins 作业设置环境中无法执行(因此出现“user interactivity has been disabled”错误消息)

    使用 PAT 作为密码,仔细检查 Jenkins Credentials“用户名和密码”。
    选择正确的凭据后,返回 URL 字段,然后键入 TAB(进入下一个字段):这会提示 Jenkins 再次尝试验证 URL。

    【讨论】:

    • 我刚试了,还是不行
    • @dbmoyal 是完全相同的错误吗?如果是,则凭据以某种方式用于不允许访问此存储库的用户。
    • 是的。我刚刚生成了一个新的 PAT,它正在工作。还是不知道怎么回事。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-24
    • 2014-01-04
    • 2013-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-24
    相关资源
    最近更新 更多