java.nio.file.DirectoryNotEmptyException: d:\tmp\woda\woda\work

Stack Overflow | user1774051 | 2 months ago
  1. 0

    Why do I encounter DirectoryNotEmptyException while deleting a directory recursively?

    Stack Overflow | 2 months ago | user1774051
    java.nio.file.DirectoryNotEmptyException: d:\tmp\woda\woda\work
  2. 0

    GitHub comment 5861#160399162

    GitHub | 1 year ago | tinwelint
    java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, C:\Users\Matilas\Desktop\db-with-legacy-indexes
  3. 0

    h3. Steps to reproduce # Create a new plan that has a single task to check out a Git repository. # In the Source Code Checkout task, tick "Force Clean Build". # In the Miscellaneous tab of the job, tick "Clean working directory after each build". # Start a Windows elastic Bamboo agent and run a couple of builds. h3. Expected results All the builds check out the code successfully and subsequently clean up the working directory. h3. Actual results The first build will pass, but an error will appear in the Bamboo error log: {quote} *Could not remove working directory for plan 'TEST-BUIL-JOB1': C:\build\TEST-BUIL-JOB1\.git* {code:none} java.nio.file.DirectoryNotEmptyException: C:\build\TEST-BUIL-JOB1\.git at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at com.atlassian.bamboo.utils.BambooPathUtils.deleteNoThrow(BambooPathUtils.java:158) at com.atlassian.bamboo.utils.BambooPathUtils.access$000(BambooPathUtils.java:28) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:97) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:74) at java.nio.file.Files.walkFileTree(Files.java:2688) at java.nio.file.Files.walkFileTree(Files.java:2742) at com.atlassian.bamboo.utils.BambooPathUtils.cleanDirectory(BambooPathUtils.java:103) at com.atlassian.bamboo.util.BambooFileUtils.cleanDirectory(BambooFileUtils.java:770) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.cleanWorkingDirectory(ExecuteBuildTask.java:129) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:98) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:132) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:123) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:122) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) {code} {quote} Subsequent builds will all fail with the error: {code:none} Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout' Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Error occurred while running Task 'Checkout Default Repository(1)' of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout. java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:144) at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:203) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:188) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.preRetrieveSourceCode(VcsCheckoutTask.java:217) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:124) at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$68(TaskExecutorImpl.java:273) at com.atlassian.bamboo.task.TaskExecutorImpl$$Lambda$20/1672639360.call(Unknown Source) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:202) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:273) at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:83) at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:74) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:132) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:123) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:122) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.bamboo.repository.RepositoryException: Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.cleanWorkingDirIfNeeded(VcsCheckoutTask.java:371) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$100(VcsCheckoutTask.java:57) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:222) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:218) at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108) ... 22 more Caused by: java.nio.file.DirectoryNotEmptyException: C:\build-dir\TEST-BUIL-JOB1\.git at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at com.atlassian.bamboo.utils.BambooPathUtils.deleteNoThrow(BambooPathUtils.java:158) at com.atlassian.bamboo.utils.BambooPathUtils.access$000(BambooPathUtils.java:28) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:97) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:74) at java.nio.file.Files.walkFileTree(Files.java:2688) at java.nio.file.Files.walkFileTree(Files.java:2742) at com.atlassian.bamboo.utils.BambooPathUtils.cleanDirectory(BambooPathUtils.java:103) at com.atlassian.bamboo.util.BambooFileUtils.cleanDirectory(BambooFileUtils.java:770) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.cleanWorkingDirIfNeeded(VcsCheckoutTask.java:365) error 04-Nov-2015 13:51:01 ... 26 more {code} h3. Workaround Add a script task to move (not delete) the {{.git}} directory out of the working directory.

    Atlassian JIRA | 1 year ago | Pavel Veller
    java.nio.file.DirectoryNotEmptyException: C:\build\TEST-BUIL-JOB1\.git
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h3. Steps to reproduce # Create a new plan that has a single task to check out a Git repository. # In the Source Code Checkout task, tick "Force Clean Build". # In the Miscellaneous tab of the job, tick "Clean working directory after each build". # Start a Windows elastic Bamboo agent and run a couple of builds. h3. Expected results All the builds check out the code successfully and subsequently clean up the working directory. h3. Actual results The first build will pass, but an error will appear in the Bamboo error log: {quote} *Could not remove working directory for plan 'TEST-BUIL-JOB1': C:\build\TEST-BUIL-JOB1\.git* {code:none} java.nio.file.DirectoryNotEmptyException: C:\build\TEST-BUIL-JOB1\.git at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at com.atlassian.bamboo.utils.BambooPathUtils.deleteNoThrow(BambooPathUtils.java:158) at com.atlassian.bamboo.utils.BambooPathUtils.access$000(BambooPathUtils.java:28) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:97) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:74) at java.nio.file.Files.walkFileTree(Files.java:2688) at java.nio.file.Files.walkFileTree(Files.java:2742) at com.atlassian.bamboo.utils.BambooPathUtils.cleanDirectory(BambooPathUtils.java:103) at com.atlassian.bamboo.util.BambooFileUtils.cleanDirectory(BambooFileUtils.java:770) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.cleanWorkingDirectory(ExecuteBuildTask.java:129) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:98) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:132) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:123) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:122) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) {code} {quote} Subsequent builds will all fail with the error: {code:none} Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout' Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Build always requires a clean checkout Cleaning build directory 'C:\build-dir\TEST-BUIL-JOB1' Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git Error occurred while running Task 'Checkout Default Repository(1)' of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout. java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:144) at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:203) at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:188) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.preRetrieveSourceCode(VcsCheckoutTask.java:217) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:124) at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$68(TaskExecutorImpl.java:273) at com.atlassian.bamboo.task.TaskExecutorImpl$$Lambda$20/1672639360.call(Unknown Source) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:202) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:273) at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:83) at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:74) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:132) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:123) at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:122) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.bamboo.repository.RepositoryException: Unable to clean source directory 'C:\build-dir\TEST-BUIL-JOB1' C:\build-dir\TEST-BUIL-JOB1\.git at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.cleanWorkingDirIfNeeded(VcsCheckoutTask.java:371) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$100(VcsCheckoutTask.java:57) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:222) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:218) at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108) ... 22 more Caused by: java.nio.file.DirectoryNotEmptyException: C:\build-dir\TEST-BUIL-JOB1\.git at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at com.atlassian.bamboo.utils.BambooPathUtils.deleteNoThrow(BambooPathUtils.java:158) at com.atlassian.bamboo.utils.BambooPathUtils.access$000(BambooPathUtils.java:28) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:97) at com.atlassian.bamboo.utils.BambooPathUtils$1.postVisitDirectory(BambooPathUtils.java:74) at java.nio.file.Files.walkFileTree(Files.java:2688) at java.nio.file.Files.walkFileTree(Files.java:2742) at com.atlassian.bamboo.utils.BambooPathUtils.cleanDirectory(BambooPathUtils.java:103) at com.atlassian.bamboo.util.BambooFileUtils.cleanDirectory(BambooFileUtils.java:770) at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.cleanWorkingDirIfNeeded(VcsCheckoutTask.java:365) error 04-Nov-2015 13:51:01 ... 26 more {code} h3. Workaround Add a script task to move (not delete) the {{.git}} directory out of the working directory.

    Atlassian JIRA | 1 year ago | Pavel Veller
    java.nio.file.DirectoryNotEmptyException: C:\build\TEST-BUIL-JOB1\.git
  6. 0

    Error unpacking capsule

    GitHub | 2 years ago | draenor
    java.lang.RuntimeException: Exception while extracting jar C:\git\foo\target\foo-0.1-SNAPSHOT-indexsvc.jar to app cache directory C:\Users\Johan\AppData\Local\capsule\apps\foo_0.1-SNAPSHOT

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.nio.file.DirectoryNotEmptyException

      d:\tmp\woda\woda\work

      at sun.nio.fs.WindowsFileSystemProvider.implDelete()
    2. Java RT
      Files.delete
      1. sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266)
      2. sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
      3. java.nio.file.Files.delete(Files.java:1126)
      3 frames
    3. com.foo.demo
      NotEmptyDirDemo$1.postVisitDirectory
      1. com.foo.demo.NotEmptyDirDemo$1.postVisitDirectory(NotEmptyDirDemo.java:32)
      2. com.foo.demo.NotEmptyDirDemo$1.postVisitDirectory(NotEmptyDirDemo.java:1)
      2 frames
    4. Java RT
      Files.walkFileTree
      1. java.nio.file.Files.walkFileTree(Files.java:2688)
      2. java.nio.file.Files.walkFileTree(Files.java:2742)
      2 frames
    5. com.foo.demo
      NotEmptyDirDemo.main
      1. com.foo.demo.NotEmptyDirDemo.removeDir(NotEmptyDirDemo.java:45)
      2. com.foo.demo.NotEmptyDirDemo.main(NotEmptyDirDemo.java:18)
      2 frames