【问题标题】:Stuck in 'sh' stage and then Process apparently never started in /home/jenkins/jenkins/workspace/卡在“sh”阶段,然后进程显然从未在 /home/jenkins/jenkins/workspace/ 中启动
【发布时间】:2021-02-08 16:59:28
【问题描述】:

“mvn clean”阶段卡住了一段时间并导致以下错误:

[Pipeline] sh
process apparently never started in /home/jenkins/jenkins/workspace/<MyProject>@tmp/durable-8e4de4ec
(running Jenkins temporarily with -D 
org.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem 
clearer)
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE

这是我的 jenkinsfile 脚本:

pipeline{
agent{
    label 'DOCKER'
}
tools { 
    maven 'M3' 
    jdk 'JAVA_HOME' 
}
stages{
    stage('build'){
        steps{
            echo 'Running Build Phase'
            sh 'mvn clean'
        }
    }
}
}

不确定我是否需要更新任何配置。我已经用更新的 open-jdk 版本更新了 /etc/init.d/jenkins。

【问题讨论】:

  • 嘿,我也遇到了类似的问题。你有什么发现吗?
  • 嗨@RanaRanvijaySingh,我不确定是什么让它起作用。我关注了一些帖子,例如stackoverflow.com/questions/58346984/… 并使用 jenkins 和 docker 配置进行了很多调整。不过,我没有更新代码中的任何依赖项。这是配置的问题。
  • 感谢您的回复,我的问题已解决。这是因为环境变量。这可能对其他人有帮助。 stackoverflow.com/questions/43987005/…

标签: docker jenkins jenkins-pipeline


【解决方案1】:

我遇到了同样的问题,发现如果你去 Manage Jenkins -> Configure System 会有一个空的环境变量在 Global Properties 部分。只需删除该变量即可解决问题。

【讨论】:

    【解决方案2】:

    结合 jenkins kubernetes-plugin 可能是here (Kubernetes plugin for Jenkins) 部分Pipeline sh step hangs when multiple containers are used 中描述的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-01
      • 1970-01-01
      • 2017-07-31
      • 2017-10-21
      • 2021-08-13
      相关资源
      最近更新 更多