Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44659

Missing workspace - workspace deleted during concurrent build


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • Jenkins ver. 2.46.1 Linux Ubuntu16.04

      I'm using pipeline to automate builds and it's possible that the same pipeline is triggered concurrently.

      What's happening is I use node ('label'), which already assigned a workspace on a slave with label 'docker_build', then i use ws() to go to another directory as workspace to build.

      Here's what I am doing:


      node ('docker_build') {
      currentBuild.description = "${MODEL_NAME}/${BUILD_TYPE} - ${BUILD_LABEL} - Executor ${EXECUTOR_NUMBER} ${NODE_NAME}"
      def actual_workspace = "/home/devops/jenkins_slave_robot/workspace/TinderBox/Chroot_Build/${PROJECT}/${EXECUTOR_NUMBER}"
      stage('Checkout') {
      ws(actual_workspace) {
      stage('Build') {jj
      sh 'whoami'
      def image = docker.image('')
      image.inside("--privileged -u root -v ${actual_workspace}:${chroot_path}/code") {

      Occasionally,  I would run into issues the missing workspace error. The build is interrupted then failedjj.  The error message looks something like this:

      ERROR: missing workspace /home/devops/jenkins_slave_robot/workspace/TinderBox/FortiOS/Build_Steps/5.4_Chroot_Build on jenkins-smoke-slave03(

      From the error message, seems like the original workspace, which was allocated when I use node('label') is disappear. I understand that when the concurrent build happens, the workspace name will come with@<number> , so I can't understand how the workspace would be gone. 

      So far it has happened twice in the last 5 months.


            elhay elhay efrat
            samsun387 Kevin Yu
            0 Vote for this issue
            13 Start watching this issue