小编Gi0*_*i0s的帖子

7
推荐指数
3
解决办法
1万
查看次数

Jenkins 管道“checkout scm”在特定节点上失败

这是两个 Jenkins 节点的故事。

在两个节点之一上checkout scm进行初始签出和节点选择后,我在 Jenkins 阶段看到一个奇怪的错误。Jenkinsfile

对于一个特定节点,Jenkins 省略了“git init”中的“git”命令,这预计会使构建失败。

我在故障节点上看到的是这样的:

> init /home/hudson/build/workspace/androidplatform_pipeline # timeout=10

在我的工作节点上,运行完全相同的管道脚本,我看到:

> git init /home/hudson/build/workspace/androidplatform_pipeline # timeout=10

我的两个节点都是 Amazon EC2 实例,因此我尝试删除失败的节点并将其替换为工作节点的克隆,但“git”命令仍然被省略。

以下是相关规格:

  • 詹金斯版本:2.46.3
  • Git 客户端插件:2.4.6
  • Git 插件:3.3.0
  • 管道:2.5
  • 流程:SCM 步骤:2.4

控制台输出(带修订):

[Pipeline] checkout
Cloning the remote Git repository
Cloning repository https://stash.*******/androidplatform.git
 >  init /home/hudson/build/workspace/androidplatform_pipeline # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /home/hudson/build/workspace/androidplatform_pipeline
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:696)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:497)
    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:153)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:336) …
Run Code Online (Sandbox Code Playgroud)

jenkins jenkins-plugins jenkins-pipeline

2
推荐指数
1
解决办法
9352
查看次数