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

build won't trigger on an empty workspace if workspace is needed for polling but build is restricted to a label

    Details

    • Similar Issues:

      Description

      I have a job which is set to poll a repository, and also uses the Polling uses certain paths behavior (include) along with the Force polling using workspace behavior.
      Polling worked properly when the workspace was already present, but after wiping the workspace it did not trigger a build.
      When I made jenkins to poll the repo via calling /git/notifyCommit?url=myrepo I got the following response:
      Scheduled polling of chef-diff-app-apt-mirror-manual
      but my job was not built
      looking into the git polling log for this job I've seen this:
      Started on Aug 25, 2015 9:43:02 AM
      No workspace is available, so can’t check for updates. (nonexisting_workspace)
      Done. Took 2 ms
      No changes

      I've tried to simplify my build to see if that resolves the issue, and realized that removing the "Restrict where this project can be run" settings solves the issue, even thought that in my setup this setting was redundant as the only node available/allowed to run jobs without explicit node restrictions was the same as I was specifying with my label.

      After I removed the restrict label and curled /git/notifyCommit again I got a build started and this in my git polling log:
      Started on Aug 25, 2015 9:55:41 AM
      No workspace is available, so can’t check for updates.
      Scheduling a new build to get a workspace. (nonexisting_workspace)
      Done. Took 1 ms
      Changes found

      Let me know if you need any more info to reproduce the issue.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Thanks very much for providing those details. I hope to follow those steps to duplicate the problem before the end of the week. I've been annoyed by exactly that problem (nonexisting_workspace) and wasn't able to find a way to duplicate the problem.

          More info will be attached to this bug report once I've had time to confirm your steps show the problem.

          Show
          markewaite Mark Waite added a comment - Thanks very much for providing those details. I hope to follow those steps to duplicate the problem before the end of the week. I've been annoyed by exactly that problem (nonexisting_workspace) and wasn't able to find a way to duplicate the problem. More info will be attached to this bug report once I've had time to confirm your steps show the problem.
          Hide
          integer Kanstantsin Shautsou added a comment -

          Also trying debug nonexisting_workspace issues...

          Show
          integer Kanstantsin Shautsou added a comment - Also trying debug nonexisting_workspace issues...
          Hide
          rsena Roberto Sena added a comment -

          Has there been any headway on this? Not sure whats going on. I have a job set up similarly to what was stated in the original problem. The job was being triggered on commit from Gitlab fine last week. Today(5/23), it was brought to my attention that the job wasn't being triggered. When I went to investigate, I saw the message

          No workspace is available, so can’t check for updates. (nonexisting_workspace)

          We currently have 10 jobs set up this way. Two of the 10 started exhibiting this behavior today. The only clean up for these jobs is from the plugin

          Wipe out repository & force clone

          Show
          rsena Roberto Sena added a comment - Has there been any headway on this? Not sure whats going on. I have a job set up similarly to what was stated in the original problem. The job was being triggered on commit from Gitlab fine last week. Today(5/23), it was brought to my attention that the job wasn't being triggered. When I went to investigate, I saw the message No workspace is available, so can’t check for updates. (nonexisting_workspace) We currently have 10 jobs set up this way. Two of the 10 started exhibiting this behavior today. The only clean up for these jobs is from the plugin Wipe out repository & force clone
          Hide
          markewaite Mark Waite added a comment -

          Sorry, no progress on it.

          Show
          markewaite Mark Waite added a comment - Sorry, no progress on it.
          Hide
          tyrael Ferenc Kovacs added a comment -

          the relevant code is here:
          https://github.com/jenkinsci/jenkins/blob/1fe9cf7b7ada45230f2bc5b8e2f1bdb93175ff9f/core/src/main/java/hudson/model/AbstractProject.java#L1415
          that check was originally added to address https://issues.jenkins-ci.org/browse/JENKINS-1348 then was tweaked a bit over the years but mostly stayed the same
          so if there is no workspace and the job has a label which isn't the current nodeName it won't trigger a build.
          I think the check against the label should be improved, AFAIK it would be perfectly legal to trigger a build if the job is assigned to a label which has online nodes matching it.

          Show
          tyrael Ferenc Kovacs added a comment - the relevant code is here: https://github.com/jenkinsci/jenkins/blob/1fe9cf7b7ada45230f2bc5b8e2f1bdb93175ff9f/core/src/main/java/hudson/model/AbstractProject.java#L1415 that check was originally added to address https://issues.jenkins-ci.org/browse/JENKINS-1348 then was tweaked a bit over the years but mostly stayed the same so if there is no workspace and the job has a label which isn't the current nodeName it won't trigger a build. I think the check against the label should be improved, AFAIK it would be perfectly legal to trigger a build if the job is assigned to a label which has online nodes matching it.
          Hide
          guptset Seth Gupton added a comment -

          Some of our builds are suffering from the exact same problem. When they have a label and the workspace is empty the builds no longer trigger.

          Show
          guptset Seth Gupton added a comment - Some of our builds are suffering from the exact same problem. When they have a label and the workspace is empty the builds no longer trigger.

            People

            • Assignee:
              Unassigned
              Reporter:
              tyrael Ferenc Kovacs
            • Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated: