我用Google搜索的行是:
remote: Invalid username or password.
回溯一点:
我在Jenkins上使用Blue Ocean创建了一个管道,以运行存储在GitHub Enterprise上的内容。我们的内部企业位于http连接(不是https或ssh)的背后。 API令牌可帮助jenkins管理员成功与github进行交互,包括获取管道并将其推送到仓库。
执行时,作业将转发给代理。该代理尝试像主机一样连接到给定的地址,但没有成功获取内容,而是收到消息:
stderr: remote: Invalid username or password.
我想弄清楚的是令牌是如何从主节点传递到代理的,为什么在我的情况下不起作用。
在进行糊涂时,我发现了几次症状-似乎没有一种适用于我的情况。
我认为正在发生的事情是该节点使用了两个因子而不是令牌,然后GIT_ASKPASS似乎又生成了令牌-在这种情况下,我不知道令牌为什么对主服务器有效,但对代理无效
这是蓝色的海洋日志-匿名性略有改变。
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository http://github.mycompany.de/myorg/myrepo.git
> git init C:\jenkins\nodes\guinode\workspace\myrepo_master-CFRRXMXQEUULVB4YKQOFGB65CQNC4U5VJKTARN2A6TSBK5PBATBA # timeout=10
Fetching upstream changes from http://github.mycompany.de/myorg/myrepo.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials GitHub Enterprise Access Token
Setting http proxy: con-ffm-asg-01.mycompany.de:8080
> git fetch --no-tags --progress http://github.mycompany.de/myorg/myrepo.git +refs/heads/master:refs/remotes/origin/master
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --no-tags --progress http://github.mycompany.de/myorg/myrepo.git +refs/heads/master:refs/remotes/origin/master" returned status code 128:
stdout:
stderr: remote: Invalid username or password.
fatal: Authentication failed for 'http://github.mycompany.de/myorg/myrepo.git/'
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2002)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1721)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:405)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:614)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:98)
at java.lang.Thread.run(Unknown Source)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from myagent.auto.mycompanywan.com/12.13.14.15:58671
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
at hudson.remoting.Channel.call(Channel.java:908)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy98.execute(Unknown Source)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:260)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Error cloning remote repo 'origin'
在代理计算机上,我可以看到正在创建的文件夹,因此执行肯定在代理端进行。
我的核心问题是令牌发生了什么以及需要发生什么以便代理计算机可以连接到我们的企业github。
答案 0 :(得分:0)
关联不是因果关系,但我在Enable Agent → Master Access Control
中激活了Jenkins -> Configure Global Security
,SCM步骤现在成功了。
编辑:我玩着凭证,删除了一些凭证并重新创建了令牌。之后,错误再次出现。取消选中该选项,单击“应用”,然后选中该选项,然后单击“应用”,为我解决了这个问题。