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

Deleting old workspaces without access rights takes slave offline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • ws-cleanup-plugin
    • None

      I'm running docker that maps a local workspace to a volume with read/write access. On run time there are some files generated in the docker image. As a result these files were created with Docker user but physically reside on Jenkins' workspace.

      The plugin cannot clean up these directories and seems to be taking the whole slave offline.
      I'm guessing that 'AccessDeniedException' is not handled:

      <===[JENKINS REMOTING CAPACITY]===>channel started
      Slave.jar version: 2.52
      This is a Unix slave
      Evacuated stdout
      Slave successfully connected and online
      log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
      log4j:WARN Please initialize the log4j system properly.
      Oct 29, 2015 11:52:58 AM hudson.plugins.ws_cleanup.Wipeout$Command invoke
      SEVERE: Unable to delete workspace
      java.nio.file.AccessDeniedException: /home/jenkins/workspace/SNAPSHOTS/security_models/security_models_FunctionalTests_ws-cleanup_1446119577715/target/it-classes/hibernate.properties
      at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
      at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
      at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
      at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
      at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
      at java.nio.file.Files.delete(Files.java:1126)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at hudson.Util.deleteFile(Util.java:247)
      at hudson.Util.deleteRecursive(Util.java:310)
      at hudson.Util.deleteContentsRecursive(Util.java:212)
      at hudson.Util.deleteRecursive(Util.java:301)
      at hudson.Util.deleteContentsRecursive(Util.java:212)
      at hudson.Util.deleteRecursive(Util.java:301)
      at hudson.Util.deleteContentsRecursive(Util.java:212)
      at hudson.Util.deleteRecursive(Util.java:301)
      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:2688)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      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)

      Oct 29, 2015 11:52:58 AM hudson.plugins.ws_cleanup.Wipeout$Command invoke
      SEVERE: Workspace not deleted successfully: /home/jenkins/workspace/SNAPSHOTS/security_models/security_models_FunctionalTests_ws-cleanup_1446119577715
      Oct 29, 2015 6:19:29 PM hudson.plugins.ws_cleanup.Wipeout$Command invoke
      SEVERE: Unable to delete workspace
      java.nio.file.AccessDeniedException: /home/jenkins/workspace/SNAPSHOTS/dataset-exec/dataset-exec_FunctionalTests_ws-cleanup_1446142768472/target/it-classes/datasetdef.yaml
      at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
      at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
      at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
      at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
      at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
      at java.nio.file.Files.delete(Files.java:1126)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at hudson.Util.deleteFile(Util.java:247)
      at hudson.Util.deleteRecursive(Util.java:310)
      at hudson.Util.deleteContentsRecursive(Util.java:212)
      at hudson.Util.deleteRecursive(Util.java:301)
      at hudson.Util.deleteContentsRecursive(Util.java:212)
      at hudson.Util.deleteRecursive(Util.java:301)
      at hudson.Util.deleteContentsRecursive(Util.java:212)
      at hudson.Util.deleteRecursive(Util.java:301)
      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:2688)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      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)

            vjuranek vjuranek
            jsniecikowski Jacek Sniecikowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: