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

Cannot delete workspace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: ws-cleanup-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.570, workspace clean up plugin 0.2.1, Debian wheezy (master+slave)
    • Similar Issues:

      Description

      After updating Jenkins from 1.567 to 1.570 and Workspace Cleanup Plugin from 0.20 to 0.21, all jobs using workspace cleanup are failing:

      ...
      00:00:00.508 Baue auf Slave comitdev1 (karma git linux fast 64bit) in Arbeitsbereich /home/jenkins-slave/jenkins-slave-fs-root/workspace/SD-2893
      00:00:00.508 
      00:00:00.508 Deleting project workspace... Using command: /home/jenkins-slave/jenkins-slave-fs-root/workspace/SD-2893/APPLICATION/artifacts 
      00:00:03.932 Using command: /home/jenkins-slave/jenkins-slave-fs-root/workspace/SD-2893/APPLICATION/artifacts 
      00:00:06.941 Using command: /home/jenkins-slave/jenkins-slave-fs-root/workspace/SD-2893/APPLICATION/artifacts 
      00:00:06.943 Cannot delete workspace: java.io.IOException: Cannot run program "/home/jenkins-slave/jenkins-slave-fs-root/workspace/SD-2893/APPLICATION/artifacts": java.io.IOException: error=13, Permission denied
      00:00:06.945 ERROR: Cannot delete workspace: java.io.IOException: Cannot run program "/home/jenkins-slave/jenkins-slave-fs-root/workspace/SD-2893/APPLICATION/artifacts": java.io.IOException: error=13, Permission denied
      00:00:06.945 [FINDBUGS] Skipping publisher since build result is FAILURE
      00:00:06.946 [PMD] Skipping publisher since build result is FAILURE
      ...
      

      I have checked the workspace, everything looks ok, file permissions are all correct. Downgrade the plugin back to 0.20 fixed the problem.

        Attachments

          Activity

          Hide
          vjuranek vjuranek added a comment -

          I've just released ws-clenaup 0.22 which contains small fix for expanding env. var. on nodes and may be related to this issue. Could you please try it and let me know if it fixes the issue? If not, could anyone provide a reproducer for this issue?
          Thanks

          Show
          vjuranek vjuranek added a comment - I've just released ws-clenaup 0.22 which contains small fix for expanding env. var. on nodes and may be related to this issue. Could you please try it and let me know if it fixes the issue? If not, could anyone provide a reproducer for this issue? Thanks
          Hide
          yoann_dubreuil Yoann Dubreuil (Inactive) added a comment -

          We also hit the issue in version 0.22. I don't have a case to reproduce, but referring to the following stacktrace, I think it's required to check for null before calling get(command) on EnvVars

          Aug 19, 2014 6:23:15 PM hudson.plugins.ws_cleanup.WsCleanup perform
          SEVERE: null
          java.lang.NullPointerException
          	at hudson.util.CaseInsensitiveComparator.compare(CaseInsensitiveComparator.java:40)
          	at hudson.util.CaseInsensitiveComparator.compare(CaseInsensitiveComparator.java:34)
          	at java.util.TreeMap.getEntryUsingComparator(TreeMap.java:369)
          	at java.util.TreeMap.getEntry(TreeMap.java:340)
          	at java.util.TreeMap.get(TreeMap.java:273)
          	at hudson.plugins.ws_cleanup.Cleanup.<init>(Cleanup.java:35)
          	at hudson.plugins.ws_cleanup.WsCleanup.perform(WsCleanup.java:165)
          	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          

          I will propose a PR with the null check if it works.

          Show
          yoann_dubreuil Yoann Dubreuil (Inactive) added a comment - We also hit the issue in version 0.22. I don't have a case to reproduce, but referring to the following stacktrace, I think it's required to check for null before calling get(command) on EnvVars Aug 19, 2014 6:23:15 PM hudson.plugins.ws_cleanup.WsCleanup perform SEVERE: null java.lang.NullPointerException at hudson.util.CaseInsensitiveComparator.compare(CaseInsensitiveComparator.java:40) at hudson.util.CaseInsensitiveComparator.compare(CaseInsensitiveComparator.java:34) at java.util.TreeMap.getEntryUsingComparator(TreeMap.java:369) at java.util.TreeMap.getEntry(TreeMap.java:340) at java.util.TreeMap.get(TreeMap.java:273) at hudson.plugins.ws_cleanup.Cleanup.<init>(Cleanup.java:35) at hudson.plugins.ws_cleanup.WsCleanup.perform(WsCleanup.java:165) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) I will propose a PR with the null check if it works.
          Hide
          yoann_dubreuil Yoann Dubreuil (Inactive) added a comment -

          I pushed a patch and a pull request here: https://github.com/jenkinsci/ws-cleanup-plugin/pull/18

          It fixes the NPE on our environment.

          Show
          yoann_dubreuil Yoann Dubreuil (Inactive) added a comment - I pushed a patch and a pull request here: https://github.com/jenkinsci/ws-cleanup-plugin/pull/18 It fixes the NPE on our environment.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Yoann Dubreuil
          Path:
          src/main/java/hudson/plugins/ws_cleanup/Cleanup.java
          http://jenkins-ci.org/commit/ws-cleanup-plugin/a8067fbb2ca46ccfbefc65714730d62267cfb7e9
          Log:
          [FIX JENKINS-23693]: Checks if delete command is null

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Yoann Dubreuil Path: src/main/java/hudson/plugins/ws_cleanup/Cleanup.java http://jenkins-ci.org/commit/ws-cleanup-plugin/a8067fbb2ca46ccfbefc65714730d62267cfb7e9 Log: [FIX JENKINS-23693] : Checks if delete command is null
          Hide
          vjuranek vjuranek added a comment -

          Hopefully fixed by PR #18, fixed is contained in 0.23 released right now. If the issue is still present, please reopen.

          Show
          vjuranek vjuranek added a comment - Hopefully fixed by PR #18 , fixed is contained in 0.23 released right now. If the issue is still present, please reopen.

            People

            • Assignee:
              vjuranek vjuranek
              Reporter:
              zhh Hua Zhang
            • Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: