首页 > 解决方案 > Jenkins Git 插件客户端不使用发布者的凭据

问题描述

当为 Jenkins 构建后操作 Git Publisher 使用 Git 插件时,它似乎没有使用前面在 SCM 设置中指定的凭据。

此处显示: 在此处输入图像描述 这是发布构建步骤的控制台输出:

21:56:14 using credential 1923f64f-615b-4a61-bd60-f9513d40ca54
21:56:14  > git tag -l jenkins-Release_Notes_SVN-34 # timeout=10
21:56:15  > git tag -a -f -m Jenkins Build #34 jenkins-Release_Notes_SVN-34-SUCCESS # timeout=10
21:56:15 Pushing HEAD to branch master at repo origin
21:56:15  > git --version # timeout=10
21:56:15 using GIT_ASKPASS to set credentials xxxx, code read+status, wit read+write, expires 1/24/2020
21:56:15  > git push https://xxx.xxxx.com/xx/xx/_git/release-notes HEAD:master # timeout=10
21:56:28 ERROR: Failed to push branch master to origin
21:56:28 hudson.plugins.git.GitException: Command "git push https://xxx.xxxx.com/xx/xx/_git/release-notes HEAD:master" returned status code 1:
21:56:28 stdout: 
21:56:28 stderr: Logon failed, use ctrl+c to cancel basic credential prompt.
21:56:28 fatal: the remote end hung up unexpectedly
21:56:28 fatal: the remote end hung up unexpectedly
21:56:28 error: RPC failed; HTTP 401 curl 22 The requested URL returned error: 401
21:56:28 Everything up-to-date
21:56:28 
21:56:28    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2318)
21:56:28    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1905)
21:56:28    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:81)
21:56:28    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:2400)
21:56:28    at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
21:56:28    at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:154)
21:56:28    at hudson.remoting.UserRequest.perform(UserRequest.java:212)
21:56:28    at hudson.remoting.UserRequest.perform(UserRequest.java:54)
21:56:28    at hudson.remoting.Request$2.run(Request.java:369)
21:56:28    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
21:56:28    at java.util.concurrent.FutureTask.run(Unknown Source)
21:56:28    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
21:56:28    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
21:56:28    at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
21:56:28    at java.lang.Thread.run(Unknown Source)
21:56:28    Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from xx.xx.xx.xx/xx.xx.xx.xxx:xx
21:56:28        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
21:56:28        at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
21:56:28        at hudson.remoting.Channel.call(Channel.java:957)
21:56:28        at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
21:56:28        at sun.reflect.GeneratedMethodAccessor404.invoke(Unknown Source)
21:56:28        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
21:56:28        at java.lang.reflect.Method.invoke(Method.java:498)
21:56:28        at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
21:56:28        at com.sun.proxy.$Proxy102.execute(Unknown Source)
21:56:28        at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:312)
21:56:28        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
21:56:28        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
21:56:28        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
21:56:28        at hudson.model.Build$BuildExecution.post2(Build.java:186)
21:56:28        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
21:56:28        at hudson.model.Run.execute(Run.java:1835)
21:56:28        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
21:56:28        at hudson.model.ResourceController.execute(ResourceController.java:97)
21:56:28        at hudson.model.Executor.run(Executor.java:429)

有人对此有任何想法吗?

标签: gitjenkins

解决方案


推荐阅读