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

Workspace cleanup fails when trying to delete files with ? in name.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ws-cleanup-plugin
    • None
    • java.runtime.name Java(TM) SE Runtime Environment
      java.runtime.version 1.8.0_51-b16
      os.arch i386
      os.name Linux
      os.version 3.14.56-3.14.5.1-amd64-16568286

      Hi,

      ws-cleanup fails on files unpacked from boost library. Reason is probably that character represented by ??

      Mar 10, 2016 9:38:27 AM hudson.plugins.ws_cleanup.Wipeout$Command invoke
      SEVERE: Unable to delete workspace
      java.io.IOException: java.lang.reflect.InvocationTargetException
      at hudson.Util.isSymlinkJava7(Util.java:377)
      at hudson.Util.isSymlink(Util.java:342)
      at hudson.Util.deleteRecursive(Util.java:308)
      at hudson.Util.deleteContentsRecursive(Util.java:220)
      at hudson.Util.deleteRecursive(Util.java:309)
      at hudson.Util.deleteContentsRecursive(Util.java:220)
      at hudson.Util.deleteRecursive(Util.java:309)
      at hudson.Util.deleteContentsRecursive(Util.java:220)
      at hudson.Util.deleteRecursive(Util.java:309)
      at hudson.Util.deleteContentsRecursive(Util.java:220)
      at hudson.Util.deleteRecursive(Util.java:309)
      at hudson.Util.deleteContentsRecursive(Util.java:220)
      at hudson.Util.deleteRecursive(Util.java:309)
      at hudson.Util.deleteContentsRecursive(Util.java:220)
      at hudson.Util.deleteRecursive(Util.java:309)
      at hudson.plugins.ws_cleanup.Wipeout$Command.invoke(Wipeout.java:73)
      at hudson.plugins.ws_cleanup.Wipeout$Command.invoke(Wipeout.java:70)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2719)
      at hudson.remoting.LocalChannel$1.call(LocalChannel.java:52)
      at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at hudson.Util.isSymlinkJava7(Util.java:372)
      ... 23 more
      Caused by: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /jenkins/jobs/QUIC_DEV/workspace_ws-cleanup_1457602706659/boost/boost_1_59_0/libs/preprocessor/doc/Appendix A ?? An Introduction to Preprocessor Metaprogramming.html
      at sun.nio.fs.UnixPath.encode(UnixPath.java:147)
      at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
      at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
      at java.io.File.toPath(File.java:2234)
      ... 27 more

      ls -lah:
      jenkins/jobs/QUIC_DEV/workspace_ws-cleanup_1457602706659/boost/boost_1_59_0/libs/preprocessor/doc# ls -lah
      total 248K
      drwxr-xr-x 8 jenkins jenkins 4.0K Mar 10 09:38 .
      drwxr-xr-x 3 jenkins jenkins 4.0K Mar 10 09:38 ..
      rw-rr- 1 jenkins jenkins 127K Jul 17 2015 Appendix A ?? An Introduction to Preprocessor Metaprogramming.html
      rw-rr- 1 jenkins jenkins 2.2K Jul 17 2015 acknowledgements.html
      rw-rr- 1 jenkins jenkins 2.0K Jul 17 2015 bibliography.html
      rw-rr- 1 jenkins jenkins 1.4K Jul 17 2015 contents.html

          [JENKINS-33452] Workspace cleanup fails when trying to delete files with ? in name.

          Daniel Danner added a comment -

          I'm experiencing the same or at least a similar issue, seemingly caused by unicode characters in the file name.

          The affected file is named AC_Raíz_Certicámara_S.A..crt and the console log shows this:

          [WS-CLEANUP] Deleting project workspace...
          ERROR: [WS-CLEANUP] Cannot delete workspace: remote file operation failed: /home/XXX/workspace/XXX at hudson.remoting.Channel@7fda8408:Channel to /XXX: java.io.IOException: Unable to delete '/home/XXX/workspace/XXX/build/tmp/sysroots/XXX/usr/share/ca-certificates/mozilla/AC_Ra??z_Certic??mara_S.A..crt'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
          ERROR: Cannot delete workspace: remote file operation failed: /home/XXX/workspace/XXX at hudson.remoting.Channel@7fda8408:Channel to /XXX: java.io.IOException: Unable to delete '/home/XXX/workspace/XXX/build/tmp/sysroots/XXX/usr/share/ca-certificates/mozilla/AC_Ra??z_Certic??mara_S.A..crt'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
          

          Daniel Danner added a comment - I'm experiencing the same or at least a similar issue, seemingly caused by unicode characters in the file name. The affected file is named AC_Raíz_Certicámara_S.A..crt and the console log shows this: [WS-CLEANUP] Deleting project workspace... ERROR: [WS-CLEANUP] Cannot delete workspace: remote file operation failed: /home/XXX/workspace/XXX at hudson.remoting.Channel@7fda8408:Channel to /XXX: java.io.IOException: Unable to delete '/home/XXX/workspace/XXX/build/tmp/sysroots/XXX/usr/share/ca-certificates/mozilla/AC_Ra??z_Certic??mara_S.A..crt' . Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. ERROR: Cannot delete workspace: remote file operation failed: /home/XXX/workspace/XXX at hudson.remoting.Channel@7fda8408:Channel to /XXX: java.io.IOException: Unable to delete '/home/XXX/workspace/XXX/build/tmp/sysroots/XXX/usr/share/ca-certificates/mozilla/AC_Ra??z_Certic??mara_S.A..crt' . Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.

          Peter Lieverdink added a comment - - edited

          I see the same problem:

          java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /var/lib/jenkins/workspace/deploy_task_ws-cleanup_1496841821383/publication/style/phoneIcon/phone_icon - s����������.png at sun.nio.fs.UnixPath.encode(UnixPath.java:147) at sun.nio.fs.UnixPath.<init>(UnixPath.java:71) at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281) at java.io.File.toPath(File.java:2234) at hudson.Util.isSymlinkJava7(Util.java:539) at hudson.Util.isSymlink(Util.java:518) at hudson.FilePath.deleteRecursive(FilePath.java:1200) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.access$1000(FilePath.java:196) at hudson.FilePath$14.invoke(FilePath.java:1180) at hudson.FilePath$14.invoke(FilePath.java:1177) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2739) at hudson.remoting.UserRequest.perform(UserRequest.java:153) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:336) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) Caused: java.io.IOException
          

          On-disk the file is called

          phone_icon - s뻵£¼.png

          Git mangles it into 

          phone_icon - s\303\253\302\273\302\265\302\243\302\274.png

          Peter Lieverdink added a comment - - edited I see the same problem: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: / var /lib/jenkins/workspace/deploy_task_ws-cleanup_1496841821383/publication/style/phoneIcon/phone_icon - s����������.png at sun.nio.fs.UnixPath.encode(UnixPath.java:147) at sun.nio.fs.UnixPath.<init>(UnixPath.java:71) at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281) at java.io.File.toPath(File.java:2234) at hudson.Util.isSymlinkJava7(Util.java:539) at hudson.Util.isSymlink(Util.java:518) at hudson.FilePath.deleteRecursive(FilePath.java:1200) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.deleteContentsRecursive(FilePath.java:1219) at hudson.FilePath.deleteRecursive(FilePath.java:1201) at hudson.FilePath.access$1000(FilePath.java:196) at hudson.FilePath$14.invoke(FilePath.java:1180) at hudson.FilePath$14.invoke(FilePath.java:1177) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2739) at hudson.remoting.UserRequest.perform(UserRequest.java:153) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:336) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) Caused: java.io.IOException On-disk the file is called phone_icon - s뻵£¼.png Git mangles it into  phone_icon - s\303\253\302\273\302\265\302\243\302\274.png

          You may want to check the encoding of the JVM running the cleanup. See https://issues.jenkins-ci.org/browse/JENKINS-12610

          Allan BURDAJEWICZ added a comment - You may want to check the encoding of the JVM running the cleanup. See https://issues.jenkins-ci.org/browse/JENKINS-12610

            olivergondza Oliver Gondža
            okunc Ondrej Kunc
            Votes:
            7 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: