Missing workspace - workspace deleted during concurrent build

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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('172.16.181.203:5000/fortios1.0:1.0.0.10')
      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(172.16.182.123)

      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.

       

            Assignee:
            elhay efrat
            Reporter:
            Kevin Yu
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: