jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-72533] nixos services.jenkins issue with 'process apparently never started in /var/lib/jenkins/workspace/'

Open
#508 0 comments 0 reactions 0 assignees View on GitHub
component:durable-task-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
30
Forks
101
PR merge metrics
No merged PRs in 30d

Description

# PROBLEM

i'm using nixos-23.11 with https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=services.jenkins

and using a "Multikonfiguration project" toolchain I always got this error message:

process apparently never started in /var/lib/jenkins/workspace/klick_Jenkinsfile-test@​tmp/durable-e8bf8417

(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)

Using this Jenkinsfile

pipeline {

    agent any
    stages {
        stage('Build') {
            steps {
                echo 'Building..'
                sh 'ls'
                sh 'nix-shell --command "just build"'
                archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
            }
        }
        stage('Test') {
            steps {
                echo 'Testing..'
                sh 'nix-shell --command "just test"'
            }
        }
        stage('Check fmt') {
            steps {
                echo 'Checking fmt..'
                  sh 'nix-shell --command "cargo fmt --check"'
                  sh 'nix-shell --command "cd frontend; cargo fmt --check"'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying....'
            }
        }
    }
}

And I've added the argument:

-Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true 

Into the systemd service using a nixpkgs clone with a hack on the service file directly but it did not provide more helpful output to the problem.

However, keeping reading the other issues here I discoverd someone mentioning an empty PATH variable being the cause. Indeed this also is the problem on NixOS.

# SOLUTION

All you have to do is to add this to the Jekinsfile:

    environment {

        PATH="/run/current-system/sw/bin"
    }

And the complete file looks like this then:

pipeline {

    agent any
    environment {
        PATH="/run/current-system/sw/bin"
    }
    stages {
        stage('Build') {
            steps {
                echo 'Building..'
                sh 'ls'
                sh 'nix-shell --command "just build"'
                archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
            }
        }
        stage('Test') {
            steps {
                echo 'Testing..'
                sh 'nix-shell --command "just test"'
            }
        }
        stage('Check fmt') {
            steps {
                echo 'Checking fmt..'
                  sh 'nix-shell --command "cargo fmt --check"'
                  sh 'nix-shell --command "cd frontend; cargo fmt --check"'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying....'
            }
        }
    }
}

A side note:

The "Free Style" Softwareproject toolchain worked without such PATH hacks. Duno why, maybe the shell is different. ALSO setting the shell interpreter command in the system settings of jenkins did not have an effect. I tried /bin/sh, /run/current-system/sw/bin/bash and /run/current-system/sw/bin/sh

---
Originally reported by qknight, imported from: nixos services.jenkins issue with 'process apparently never started in /var/lib/jenkins/workspace/'


  • status: Open
  • priority: Minor
  • component(s): durable-task-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-09

Raw content of original issue

# PROBLEM

i'm using nixos-23.11 with https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=services.jenkins

and using a "Multikonfiguration project" toolchain I always got this error message:
process apparently never started in /var/lib/jenkins/workspace/klick_Jenkinsfile-test@tmp/durable-e8bf8417
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
Using this Jenkinsfile



pipeline {

    agent any
    stages {
        stage('Build') {
            steps {
                echo 'Building..'
                sh 'ls'
                sh 'nix-shell --command "just build"'
                archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
            }
        }
        stage('Test') {
            steps {
                echo 'Testing..'
                sh 'nix-shell --command "just test"'
            }
        }
        stage('Check fmt') {
            steps {
                echo 'Checking fmt..'
                  sh 'nix-shell --command "cargo fmt --check"'
                  sh 'nix-shell --command "cd frontend; cargo fmt --check"'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying....'
            }
        }
    }
}


And I've added the argument:



-Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true 


Into the systemd service using a nixpkgs clone with a hack on the service file directly but it did not provide more helpful output to the problem.

However, keeping reading the other issues here I discoverd someone mentioning an empty PATH variable being the cause. Indeed this also is the problem on NixOS.

# SOLUTION

All you have to do is to add this to the Jekinsfile:



    environment {

        PATH="/run/current-system/sw/bin"
    }


And the complete file looks like this then:



pipeline {

    agent any
    environment {
        PATH="/run/current-system/sw/bin"
    }
    stages {
        stage('Build') {
            steps {
                echo 'Building..'
                sh 'ls'
                sh 'nix-shell --command "just build"'
                archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
            }
        }
        stage('Test') {
            steps {
                echo 'Testing..'
                sh 'nix-shell --command "just test"'
            }
        }
        stage('Check fmt') {
            steps {
                echo 'Checking fmt..'
                  sh 'nix-shell --command "cargo fmt --check"'
                  sh 'nix-shell --command "cd frontend; cargo fmt --check"'
            }
        }
        stage('Deploy') {
            steps {
                echo 'Deploying....'
            }
        }
    }
}


A side note:

The "Free Style" Softwareproject toolchain worked without such PATH hacks. Duno why, maybe the shell is different. ALSO setting the shell interpreter command in the system settings of jenkins did not have an effect. I tried /bin/sh, /run/current-system/sw/bin/bash and /run/current-system/sw/bin/sh

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.