AEM 6.3 offline Tar compaction error under Windows
I am doing an offline Tar compaction on AEM 6.3 on Windows using oak-run v1.6.6. The commands are bing run in an administrative command window and AEM has been sucessfully shut down (ie no Java processes are running)
I am seeing the following error:
10:35:14.202 [main] WARN o.a.j.oak.segment.file.FileReaper - Unable to remove file C:\Adobe\aem6.3\.\crx-quickstart\repository\segmentstore\data00016a.tar
java.nio.file.FileSystemException: C:\Adobe\aem6.3\.\crx-quickstart\repository\segmentstore\data00016a.tar: The process cannot access the file because it is being used by another process.
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source) ~[na:1.8.0_161]
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) ~[na:1.8.0_161]
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) ~[na:1.8.0_161]
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source) ~[na:1.8.0_161]
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source) ~[na:1.8.0_161]
at java.nio.file.Files.deleteIfExists(Unknown Source) ~[na:1.8.0_161]
at org.apache.jackrabbit.oak.segment.file.FileReaper.reap(FileReaper.java:73) ~[oak-run-1.6.6.jar:1.6.6]
at org.apache.jackrabbit.oak.segment.file.FileStore.close(FileStore.java:496) [oak-run-1.6.6.jar:1.6.6]
at org.apache.jackrabbit.oak.segment.tool.Compact.compact(Compact.java:138) [oak-run-1.6.6.jar:1.6.6]
at org.apache.jackrabbit.oak.segment.tool.Compact.run(Compact.java:112) [oak-run-1.6.6.jar:1.6.6]
at org.apache.jackrabbit.oak.run.SegmentTarUtils.compact(SegmentTarUtils.java:206) [oak-run-1.6.6.jar:1.6.6]
at org.apache.jackrabbit.oak.run.CompactCommand.execute(CompactCommand.java:92) [oak-run-1.6.6.jar:1.6.6]
at org.apache.jackrabbit.oak.run.Mode.execute(Mode.java:65) [oak-run-1.6.6.jar:1.6.6]
at org.apache.jackrabbit.oak.run.Main.main(Main.java:49) [oak-run-1.6.6.jar:1.6.6]
I am not sure why it is failing to delete these files. I have tested it on Windows 10 and Windows Server 2012 R2 - same thing happens