<p>I am stuck in trying to get a Jenkinsfile to work. It keeps failing on <code>sh</code> step and gives the following error</p>

<pre><code>    process apparently never started in /home/jenkins/workspace
    ...
    (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
</code></pre>

<p>I have tried adding </p>

<pre><code>withEnv(['PATH+EXTRA=/usr/sbin:/usr/bin:/sbin:/bin'])
</code></pre>

<p>before sh step in groovy file</p>

<p>also tried to add </p>

<pre><code>/bin/sh 
</code></pre>

<p>in <code>Manage Jenkins -&gt; Configure System</code> in the shell section</p>

<p>I have also tried replacing the sh line in Jenkinsfile with the following:</p>

<pre><code>sh "docker ps;"
sh "echo 'hello';"
sh ./build.sh;"
sh ```
#!/bin/sh
echo hello
```
</code></pre>

<p>This is the part of Jenkinsfile which i am stuck on</p>

<pre><code>node {
    stage('Build') {
        echo 'this works'
        sh 'echo "this does not work"'
    }
}
</code></pre>

<p>expected output is "this does not work" but it just hangs and returns the error above.</p>

<p>what am I missing?</p>

Bilal Ahmad
<p>It turns out that the default workingDir value for default jnlp k8s slave nodes is now set to <code>/home/jenkins/agent</code> and I was using the old value <code>/home/jenkins</code></p>

<p>here is the config that worked for me</p>

<pre><code>containerTemplate(name: 'jnlp', image: 'lachlanevenson/jnlp-slave:3.10-1-alpine', args: '${computer.jnlpmac} ${computer.name}', workingDir: '/home/jenkins/agent')
</code></pre>
