Problem
Build requests may fail randomly uploading or downloading a file from a repository backed with a file based blobstore. The HTTP response from Nexus Repository 3 will be a 500 status code.
The nexus.log will record entries similar to the following:
2025-02-10 13:07:20,276+0000 WARN [qtp2124244507-2042] admin org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: PUT /repository/<repository-name>/path/to/asset
org.sonatype.nexus.blobstore.api.BlobStoreException: BlobId: tmp$cfeaa712-d4c9-4aa3-987d-fec16f758af5, java.nio.file.NoSuchFileException: /nexus-data/blobs/default/content/tmp/tmp$cfeaa712-d4c9-4ba3-987d-fec16f758af5.20c6764f-8018-4eaa-bdc3-e94c5ac74de8.bytes, ...
Or
2025-02-10 17:40:24,649+0000 WARN [qtp1327169763-151] *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /repository/<repository-name>/path/to/asset
org.sonatype.nexus.blobstore.api.BlobStoreException: BlobId: tmp$487dc264-6367-401e-855a-db0c7bbdd6af, java.nio.file.FileAlreadyExistsException: /nexus-data/blobs/default/content/tmp, ...
Diagnosis
There is a known issue affecting Nexus Repository 3.77.0 or 3.77.1.
If the logged Java stacktrace includes `org.sonatype.nexus.blobstore.file.FileBlobStore.tryCreate`, as shown below, this issue is currently being investigated under the internal issue id NEXUS-46021. Monitor the official release notes for fixes for this issue.
at org.sonatype.nexus.blobstore.file.FileBlobStore.tryCreate(FileBlobStore.java:465)
at org.sonatype.nexus.blobstore.file.FileBlobStore.create(FileBlobStore.java:395)
at org.sonatype.nexus.blobstore.file.FileBlobStore.doCreate(FileBlobStore.java:348)
at org.sonatype.nexus.blobstore.metrics.BlobStoreAnalyticsInterceptor.invoke(BlobStoreAnalyticsInterceptor.java:60)
at org.sonatype.nexus.blobstore.BlobStoreSupport.create(BlobStoreSupport.java:152)
at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:298)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
at org.sonatype.nexus.blobstore.BlobStoreSupport.create(BlobStoreSupport.java:136)
Workaround
Create an empty directory under the file blobstore's tmp directory. This empty directory will prevent the blobstore tmp directory from being incorrectly deleted.
For example if your file based blobstore is located at path /nexus-data/blobs/default
then create an empty directory under its content/tmp directory using a command such as:
mkdir -p /nexus-data/blobs/default/content/tmp/workaround-NEXUS-46021