Jenkins workflow-multibranch with git - IllegalStateException
Jenkins workflow-multibranch with git - IllegalStateException
我正在尝试使用 Jenkins 的 workflow-multibranch 插件和 git 创建一个多分支作业。在正常工作流作业中正常工作的凭据在尝试索引分支时在多分支作业中产生以下错误:
Started
Setting origin to git@github.com:XXXXX/XXXXXXX.git
Fetching origin...
FATAL: Failed to recompute children of Branch Indexing
java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
at com.trilead.ssh2.Connection.openSession(Connection.java:1127)
at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:672)
at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:171)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:141)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:295)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:151)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:106)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE
虽然 Jenkins 本身是 1.636,但最新的是 1.642,但我了解最新的插件。
有什么我遗漏的吗?
听起来像是 Git 插件中的错误,但无论如何安装 GitHub Branch Source 插件,它比通用连接效果更好。
这是一个错误,请参阅 https://issues.jenkins-ci.org/browse/JENKINS-33983。
我在那里提到的解决方法是进入 "Manage Jenkins" -> "Global Tool Configuration" 然后在 "Git" 下单击 "Add Git" 然后 select "JGit"。另见 https://wiki.jenkins-ci.org/display/JENKINS/Git+plugin+2.0+beta+testing#Gitplugin2.0betatesting-ActivatingJGit。
想补充一点,我还必须进入全局凭证并添加一个指向您的 ssh 授权文件的条目。然后从您作业的 Git 配置中引用此密钥。
我正在尝试使用 Jenkins 的 workflow-multibranch 插件和 git 创建一个多分支作业。在正常工作流作业中正常工作的凭据在尝试索引分支时在多分支作业中产生以下错误:
Started
Setting origin to git@github.com:XXXXX/XXXXXXX.git
Fetching origin...
FATAL: Failed to recompute children of Branch Indexing
java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
at com.trilead.ssh2.Connection.openSession(Connection.java:1127)
at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:672)
at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:171)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:141)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:295)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:151)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:106)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE
虽然 Jenkins 本身是 1.636,但最新的是 1.642,但我了解最新的插件。
有什么我遗漏的吗?
听起来像是 Git 插件中的错误,但无论如何安装 GitHub Branch Source 插件,它比通用连接效果更好。
这是一个错误,请参阅 https://issues.jenkins-ci.org/browse/JENKINS-33983。
我在那里提到的解决方法是进入 "Manage Jenkins" -> "Global Tool Configuration" 然后在 "Git" 下单击 "Add Git" 然后 select "JGit"。另见 https://wiki.jenkins-ci.org/display/JENKINS/Git+plugin+2.0+beta+testing#Gitplugin2.0betatesting-ActivatingJGit。
想补充一点,我还必须进入全局凭证并添加一个指向您的 ssh 授权文件的条目。然后从您作业的 Git 配置中引用此密钥。