If a large file is uploaded while a snapshot removal task is running it can fail with a file not found error. This is a rare race condition, but it can happen.
This is because the directories needed in the target repository are made here:
Only after this is the file actually stored, and then after it is stored Nexus attempts to rename it to it's final destination:
But at that point a snapshot removal task may have deleted it's destination directory.
This was actually observed in a user's log files. They had an upload that finished at "26/Sep/2017:07:39:42 -0700", and ran for 790 seconds.
A snapshot removal task finished at 07:35:32:
2017-09-26 07:35:32 INFO [pxpool-1-thread-8] *TASK org.sonatype.nexus.maven.tasks.SnapshotRemoverTask - Scheduled task (Clean snapshots) finished :: Removing snapshots from repository snapshots (started 2017-09-26T07:00:00-07:00, runtime 0:35:32.538)
And then a few minutes later the upload failed because the destination directory didn't exist anymore.
2017-09-26 07:39:41 WARN [qtp1960493218-140575] ctodev org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer - Could not delete file: /nexus-data/snapshots/com/somewhere/someplace/someproject/someartifact/2017R11-8fd74a7132-SNAPSHOT/someartifact-2017R11-8fd74a7132-20170926.142632-1.zip
java.nio.file.NoSuchFileException: /nexus-data/snapshots/.nexus/tmp/someartifact-2017R11-8fd74a7132-20170926.142632-1.zipnx-tmp383300099789364522.nx-upload -> /nexus-data/snapshots/com/somewhere/someplace/someproject/someartifact/2017R11-8fd74a7132-SNAPSHOT/someartifact-2017R11-8fd74a7132-20170926.142632-1.zip