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

Improve error message when recursive delete fails at some file

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ws-cleanup-plugin
    • None

      When recursively removing a directory fails you may get this error message:

      ERROR: Cannot delete workspace :Unable to delete 'C:\Jenkins\workspace\master@3'. Tried 3 times (of a maximum of 3) waiting 0,1 sec between attempts.

      This error message doesn't say which file that couldn't be removed so it's hard to debug / understand what has happened.

      However, it looks like the file name is returned to ws-cleanup-plugin as a suppressed exception inside the thrown CompositeIOException (thrown by class PathRemover). It would be helpful if the suppressed exceptions were logged by we-cleanup-plugin.

       

      Git client plugin does:

      try {
        Util.deleteContentsRecursive(workspace);
      } catch (Exception e) {
        e.printStackTrace(listener.error("Failed to clean the workspace"));

      ... which seems to print the suppressed exceptions

            olivergondza Oliver Gondža
            robho Robert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: