4

I am currently having an issue with Jenkins running on Ubuntu 18.04. The sh pipeline step hangs and eventually times out with the following message:

[Pipeline] sh
process apparently never started in /var/lib/jenkins/workspace/members-only-demo@tmp/durable-494a3b0d
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
Cannot contact : java.io.FileNotFoundException: File '/var/lib/jenkins/workspace/members-only-demo@tmp/durable-494a3b0d/output.txt' does not exist

Here is the thread dump:

Thread #6
    at DSL.sh(completed process (code -2) in /var/lib/jenkins/workspace/members-only-demo@tmp/durable-494a3b0d; recurrence period: 15000ms; check task scheduled; cancelled? false done? false)
    at WorkflowScript.run(WorkflowScript:9)
    at DSL.stage(Native Method)
    at WorkflowScript.run(WorkflowScript:8)
    at DSL.node(running on )
    at WorkflowScript.run(WorkflowScript:3)

The pipeline script is as follows:

#!/usr/bin/env groovy
node {
        stage('Checkout') {
            checkout([$class: 'GitSCM', branches: [[name: '*/da-demo']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'TeamHub2', url: 'hth@helixteamhub.cloud:digitalarchitects/projects/slender-man/repositories/git/members-only-app']]])
        }
        stage('Create Build Dir') {
            sh label: '', returnStdout: true, script: 'rm --recursive --force ${env.WORKSPACE}/build/'
            sh 'mkdir --parents ${env.WORKSPACE}/build/coverage ${env.WORKSPACE}/build/logs ${env.WORKSPACE}/build/pdepend'
        }
   ...
}

I am not really sure how to troubleshoot this issue. Can anyone help please?

3 Answers 3

3

After plugins update had the same issue with Jenkins k8s nodes, turns out that default workingDir value for default jnlp k8s node is now set to /home/jenkins/agent, whereas for second container in pod I set it to /home/jenkins.

Switching workingDir to /home/jenkins/agent for the second container in pod fixed the problem.

1
  • I had a similar issue but on a Windows node (yes using sh hung), the issue was that my workingDir was set to /temp (which is invalid on windows), after changing it to "C:\temp" it worked.
    – CJCombrink
    Oct 2, 2019 at 6:43
1

I ended up reinstalling jenkins using apt-get --purge remove jenkins then apt-get install jenkins. Sadly everything must be configured again, but the problem has been solved.

0

I had the same issue. It was due to kubernetes pod security Policy. after relaxing pod policy it was ok.

1
  • 1
    Can you provide more details? Please do not respond in comments; edit your answer to make it clearer and more complete. Jun 26, 2020 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.