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

Workspace Cleanup occurs before SCP / CIFS publishing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: ws-cleanup-plugin
    • Labels:
      None
    • Environment:
      Jenkins v1.414, ws-cleanup v0.5, multi-configuration jobs, publish over cifs v0.2, publish of scp v1.8.
    • Similar Issues:

      Description

      When publishing post-build actions are configured, an order of operations problem can occur where the workspace plugin runs first - cleaning up everything before it can be published. The artifact publishing (SCP or CIFS) then runs and can't find the files it needs to upload, causing failed/unstable build runs respectively.

      CIFS Log:
      BUILD SUCCESSFUL
      Total time: 42 seconds
      Deleting project workspace... done
      CIFS: Failed to get hostname [********: ********]
      CIFS: Connecting with configuration [BuildRepository] ...
      CIFS: Disconnecting configuration [BuildRepository] ...
      ERROR: Exception when publishing, exception message [The base directory does not exist. If this is a promotion, have you "Archived the artifacts"?]
      Build step 'Send build artifacts to a windows share' changed build result to UNSTABLE

      SCP Log:
      BUILD SUCCESSFUL
      Total time: 1 minute 2 seconds
      Deleting project workspace... done
      [SCP] Connecting to *************
      ERROR: Publisher be.certipost.hudson.plugin.SCPRepositoryPublisher aborted due to exception
      /var/lib/build/******* does not exist.
      at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:474)
      at hudson.FilePath.glob(FilePath.java:1240)
      at hudson.FilePath.access$600(FilePath.java:164)
      at hudson.FilePath$23.invoke(FilePath.java:1219)
      at hudson.FilePath$23.invoke(FilePath.java:1217)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1980)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:270)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
      Email was triggered for: Failure

        Attachments

          Activity

          Hide
          hokatichen Mike Elkin added a comment -

          Patch using ordinal attribute on the extension annotation

          Show
          hokatichen Mike Elkin added a comment - Patch using ordinal attribute on the extension annotation
          Hide
          vjuranek vjuranek added a comment -

          Hi,
          thanks for the patch!
          I'm going to change @Extension(ordinal=-99999) to positive value (@Extension(ordinal=99999)) in case of PreBuildCleanup, as this clean up is done when build starts in this case, therefore IMHO it should be on of the first actions. Or is there any reason, why it should be the last action within "preCheckout" step?

          Show
          vjuranek vjuranek added a comment - Hi, thanks for the patch! I'm going to change @Extension(ordinal=-99999) to positive value (@Extension(ordinal=99999)) in case of PreBuildCleanup, as this clean up is done when build starts in this case, therefore IMHO it should be on of the first actions. Or is there any reason, why it should be the last action within "preCheckout" step?
          Hide
          hokatichen Mike Elkin added a comment -

          I totally missed the pre-step - that behavior sounds correct to me. For release notes I believe that users will have to save the job to get the new ordering

          Show
          hokatichen Mike Elkin added a comment - I totally missed the pre-step - that behavior sounds correct to me. For release notes I believe that users will have to save the job to get the new ordering
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Vojtech Juranek
          Path:
          src/main/java/hudson/plugins/ws_cleanup/PreBuildCleanup.java
          src/main/java/hudson/plugins/ws_cleanup/WsCleanup.java
          http://jenkins-ci.org/commit/ws-cleanup-plugin/0a2a1286a73fe0be019d6c972a0352b591f41368
          Log:
          JENKINS-11210 - ws-cleanup should be excuted as the first or the last step in case of pre build cleanup or post build cleanup, respectively

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtech Juranek Path: src/main/java/hudson/plugins/ws_cleanup/PreBuildCleanup.java src/main/java/hudson/plugins/ws_cleanup/WsCleanup.java http://jenkins-ci.org/commit/ws-cleanup-plugin/0a2a1286a73fe0be019d6c972a0352b591f41368 Log: JENKINS-11210 - ws-cleanup should be excuted as the first or the last step in case of pre build cleanup or post build cleanup, respectively
          Hide
          vjuranek vjuranek added a comment -

          Should be fixed in 0.6

          Show
          vjuranek vjuranek added a comment - Should be fixed in 0.6

            People

            • Assignee:
              vjuranek vjuranek
              Reporter:
              hokatichen Mike Elkin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: