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

Running a multibranch pipeline job results in missing workspace error

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I build my own Jenkins image and check it's sanity by starting in in a docker container and trying to login to it. I achieve this using the following Jenkinsfile:

          stages {
              stage('Build Jenkins Master Image') {
                  steps {
                      sh(
                              script: """
                                  cd Jenkins-Master
                                  docker pull jenkins:latest
                                  docker build --rm -t ${IMAGE_TAG} .
                              """
                      )
                  }
              }
              stage('Image sanity check') {
                  steps {
                      withCredentials([string(credentialsId: 'CASC_VAULT_TOKEN', variable: 'CASC_VAULT_TOKEN'),
                                       usernamePassword(credentialsId: 'Forge_service_account', passwordVariable: 'JENKINS_PASSWORD', usernameVariable: 'JENKINS_LOGIN')]) {
                          sh(
                              script: """
                                      docker run -e CASC_VAULT_TOKEN=${CASC_VAULT_TOKEN} \
                                                 --name jenkins \
                                                 -d \
                                                 -p 8080:8080 ${IMAGE_TAG}
                                      mvn -Djenkins.test.timeout=${GLOBAL_TEST_TIMEOUT} -B -f Jenkins-Master/pom.xml test
                                      """
                          )
                      }
                  }
              }
      

      The test is successful, but the build fails with the following log:

      [2019-11-25T10:33:38.333Z] Nov 25, 2019 11:33:37 AM ch.ti8m.forge.jenkins.logintest.LocalhostJenkinsRule before
      [2019-11-25T10:33:38.333Z] INFO: Waiting for Jenkins instance... (response code 503)
      [2019-11-25T10:33:43.628Z] Nov 25, 2019 11:33:42 AM ch.ti8m.forge.jenkins.logintest.LocalhostJenkinsRule before
      [2019-11-25T10:33:43.628Z] INFO: Waiting for Jenkins instance... (response code 503)
      [Pipeline] }
      [Pipeline] // withCredentials
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Push Jenkins Master Image)
      Stage "Push Jenkins Master Image" skipped due to earlier failure(s)
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // ansiColor
      [Pipeline] }
      [Pipeline] // timeout
      [Pipeline] }
      [Pipeline] // timestamps
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: missing workspace /data/ci/workspace/orge_ti8m-ci-2.0_main-instance_8 on srvzh-jenkinsnode-tst-005
      Finished: FAILURE
      

      As I debug in workflow-durable-task-step I notice a strange behavior. My breakpoint is set to DurableTaskStep.java#L386, when it halts there, it means ws.isDirectory() returned false. But during this break in debugger I evaluate ws.isDirectory() manually and it returns true.



      Any ideas what might cause this?

        Attachments

          Activity

          smasher Daniel Estermann created issue -
          smasher Daniel Estermann made changes -
          Field Original Value New Value
          Description I build my own Jenkins image and check it's sanity by starting in in a docker container and trying to login to it. I achieve this using the following Jenkinsfile:

          {code}
              stages {
                  stage('Build Jenkins Master Image') {
                      steps {
                          sh(
                                  script: """
                                      cd Jenkins-Master
                                      docker pull jenkins:latest
                                      docker build --rm -t ${IMAGE_TAG} .
                                  """
                          )
                      }
                  }
                  stage('Image sanity check') {
                      steps {
                          withCredentials([string(credentialsId: 'CASC_VAULT_TOKEN', variable: 'CASC_VAULT_TOKEN'),
                                           usernamePassword(credentialsId: 'Forge_service_account', passwordVariable: 'JENKINS_PASSWORD', usernameVariable: 'JENKINS_LOGIN')]) {
                              sh(
                                  script: """
                                          docker run -e CASC_VAULT_TOKEN=${CASC_VAULT_TOKEN} \
                                                     --name jenkins \
                                                     -d \
                                                     -p 8080:8080 ${IMAGE_TAG}
                                          mvn -Djenkins.test.timeout=${GLOBAL_TEST_TIMEOUT} -B -f Jenkins-Master/pom.xml test
                                          """
                              )
                          }
                      }
                  }
          {code}

          The test is successful, but the build fails with the following log:

          {code}
          [2019-11-25T10:33:38.333Z] Nov 25, 2019 11:33:37 AM ch.ti8m.forge.jenkins.logintest.LocalhostJenkinsRule before
          [2019-11-25T10:33:38.333Z] INFO: Waiting for Jenkins instance... (response code 503)
          [2019-11-25T10:33:43.628Z] Nov 25, 2019 11:33:42 AM ch.ti8m.forge.jenkins.logintest.LocalhostJenkinsRule before
          [2019-11-25T10:33:43.628Z] INFO: Waiting for Jenkins instance... (response code 503)
          [Pipeline] }
          [Pipeline] // withCredentials
          [Pipeline] }
          [Pipeline] // withEnv
          [Pipeline] }
          [Pipeline] // stage
          [Pipeline] stage
          [Pipeline] { (Push Jenkins Master Image)
          Stage "Push Jenkins Master Image" skipped due to earlier failure(s)
          [Pipeline] }
          [Pipeline] // stage
          [Pipeline] }
          [Pipeline] // withEnv
          [Pipeline] }
          [Pipeline] // ansiColor
          [Pipeline] }
          [Pipeline] // timeout
          [Pipeline] }
          [Pipeline] // timestamps
          [Pipeline] }
          [Pipeline] // withEnv
          [Pipeline] }
          [Pipeline] // withEnv
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          ERROR: missing workspace /data/ci/workspace/orge_ti8m-ci-2.0_main-instance_8 on srvzh-jenkinsnode-tst-005
          Finished: FAILURE
          {code}

          As I debug in {{workflow-durable-task-step}} I notice a strange behavior. My breakpoint is set to [DurableTaskStep.java#L386|https://github.com/jenkinsci/workflow-durable-task-step-plugin/blob/bbc10c7ef26ba70cd2e85b3b3105c12ee9ec9692/src/main/java/org/jenkinsci/plugins/workflow/steps/durable_task/DurableTaskStep.java#L386], when it halts there, it means {{ws.isDirectory()}}} returned {{false}}. But during this break in debugger I evaluate {{ws.isDirectory()}} manually and it returns {{true}}.

           !image-2019-11-25-12-00-07-262.png|thumbnail!
           !image-2019-11-25-12-00-29-961.png|thumbnail!
           !image-2019-11-25-12-00-35-176.png|thumbnail!

          Any ideas what might cause this?
          I build my own Jenkins image and check it's sanity by starting in in a docker container and trying to login to it. I achieve this using the following Jenkinsfile:

          {code}
              stages {
                  stage('Build Jenkins Master Image') {
                      steps {
                          sh(
                                  script: """
                                      cd Jenkins-Master
                                      docker pull jenkins:latest
                                      docker build --rm -t ${IMAGE_TAG} .
                                  """
                          )
                      }
                  }
                  stage('Image sanity check') {
                      steps {
                          withCredentials([string(credentialsId: 'CASC_VAULT_TOKEN', variable: 'CASC_VAULT_TOKEN'),
                                           usernamePassword(credentialsId: 'Forge_service_account', passwordVariable: 'JENKINS_PASSWORD', usernameVariable: 'JENKINS_LOGIN')]) {
                              sh(
                                  script: """
                                          docker run -e CASC_VAULT_TOKEN=${CASC_VAULT_TOKEN} \
                                                     --name jenkins \
                                                     -d \
                                                     -p 8080:8080 ${IMAGE_TAG}
                                          mvn -Djenkins.test.timeout=${GLOBAL_TEST_TIMEOUT} -B -f Jenkins-Master/pom.xml test
                                          """
                              )
                          }
                      }
                  }
          {code}

          The test is successful, but the build fails with the following log:

          {code}
          [2019-11-25T10:33:38.333Z] Nov 25, 2019 11:33:37 AM ch.ti8m.forge.jenkins.logintest.LocalhostJenkinsRule before
          [2019-11-25T10:33:38.333Z] INFO: Waiting for Jenkins instance... (response code 503)
          [2019-11-25T10:33:43.628Z] Nov 25, 2019 11:33:42 AM ch.ti8m.forge.jenkins.logintest.LocalhostJenkinsRule before
          [2019-11-25T10:33:43.628Z] INFO: Waiting for Jenkins instance... (response code 503)
          [Pipeline] }
          [Pipeline] // withCredentials
          [Pipeline] }
          [Pipeline] // withEnv
          [Pipeline] }
          [Pipeline] // stage
          [Pipeline] stage
          [Pipeline] { (Push Jenkins Master Image)
          Stage "Push Jenkins Master Image" skipped due to earlier failure(s)
          [Pipeline] }
          [Pipeline] // stage
          [Pipeline] }
          [Pipeline] // withEnv
          [Pipeline] }
          [Pipeline] // ansiColor
          [Pipeline] }
          [Pipeline] // timeout
          [Pipeline] }
          [Pipeline] // timestamps
          [Pipeline] }
          [Pipeline] // withEnv
          [Pipeline] }
          [Pipeline] // withEnv
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          ERROR: missing workspace /data/ci/workspace/orge_ti8m-ci-2.0_main-instance_8 on srvzh-jenkinsnode-tst-005
          Finished: FAILURE
          {code}

          As I debug in {{workflow-durable-task-step}} I notice a strange behavior. My breakpoint is set to [DurableTaskStep.java#L386|https://github.com/jenkinsci/workflow-durable-task-step-plugin/blob/bbc10c7ef26ba70cd2e85b3b3105c12ee9ec9692/src/main/java/org/jenkinsci/plugins/workflow/steps/durable_task/DurableTaskStep.java#L386], when it halts there, it means {{ws.isDirectory()}} returned {{false}}. But during this break in debugger I evaluate {{ws.isDirectory()}} manually and it returns {{true}}.

           !image-2019-11-25-12-00-07-262.png|thumbnail!
           !image-2019-11-25-12-00-29-961.png|thumbnail!
           !image-2019-11-25-12-00-35-176.png|thumbnail!

          Any ideas what might cause this?
          smasher Daniel Estermann made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
          smasher Daniel Estermann made changes -
          Status Fixed but Unreleased [ 10203 ] Closed [ 6 ]

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            smasher Daniel Estermann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: