Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-24032

file based blobstores are not reliably tested for writable which can cause some blobstore operations to fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.14.0, 3.22.1
    • Fix Version/s: None
    • Component/s: Blobstore
    • Notability:
      n/a

      Description

      FileBlobStore.isStorageAvailable() method does not reliably test if a blobstore is writable due to its use of Files.getFileStore(Path).isReadOnly()

      In the above case, the contentDir value on OSX was to a writable blobstore path, but on OSX the file store "/" is not writable, thus the test fails and results in the following logged messages:

      2020-05-22 13:51:57,454-0500 WARN  [quartz-4-thread-11]  *SYSTEM org.sonatype.nexus.blobstore.file.FileBlobStore - File blob store ‘blobflex’ is not writable. Read only: true. Usable space: 166132547584
      2020-05-22 13:51:57,455-0500 WARN  [quartz-4-thread-11]  *SYSTEM org.sonatype.nexus.blobstore.file.FileBlobStore - File blob store ‘blob01’ is not writable. Read only: true. Usable space: 166132547584
      2020-05-22 13:51:57,455-0500 WARN  [quartz-4-thread-11]  *SYSTEM org.sonatype.nexus.blobstore.file.FileBlobStore - File blob store ‘default-promoted’ is not writable. Read only: true. Usable space: 166132547584
      
      2020-05-22 16:29:35,871-0300 WARN  [quartz-4-thread-14] *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskJob - Task 1f258092-f809-45ef-8d1c-70dd777c3efd : 'System - Repository Health Check: spring-io' [healthcheck] execution failure
      org.sonatype.nexus.blobstore.api.BlobStoreException: Unable to find a member Blob Store of 'BlobStoreGroup$$EnhancerByGuice$$64c50abe{name='default',members='[org.sonatype.nexus.blobstore.file.FileBlobStore$$EnhancerByGuice$$c33b5734@59557d1d, org.sonatype.nexus.blobstore.file.FileBlobStore$$EnhancerByGuice$$c33b5734@7f68a1f3, org.sonatype.nexus.blobstore.file.FileBlobStore$$EnhancerByGuice$$c33b5734@74848488]'}' for create
      	at org.sonatype.nexus.blobstore.group.BlobStoreGroup.create(BlobStoreGroup.java:186)
      	at org.sonatype.nexus.blobstore.group.BlobStoreGroup.create(BlobStoreGroup.java:174)
      	at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      	at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
      	at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53)
      	at org.sonatype.nexus.blobstore.group.BlobStoreGroup.create(BlobStoreGroup.java:168)
      	at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      	at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
      	at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53)
      	at com.sonatype.nexus.plugins.healthcheck.service.impl.WebServerServiceImpl.extract(WebServerServiceImpl.java:128)
      	at com.sonatype.nexus.plugins.healthcheck.service.impl.WebServerServiceImpl.extractBundle(WebServerServiceImpl.java:115)
      	at com.sonatype.nexus.plugins.healthcheck.task.HealthCheckTask.doDownload(HealthCheckTask.java:417)
      	at com.sonatype.nexus.plugins.healthcheck.task.HealthCheckTask.doRunSafe(HealthCheckTask.java:201)
      	at com.sonatype.nexus.plugins.healthcheck.task.HealthCheckTask.execute(HealthCheckTask.java:124)
      	at com.sonatype.nexus.plugins.healthcheck.task.HealthCheckTask.execute(HealthCheckTask.java:1)
      	at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:100)
      	at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:143)
      	at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:106)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.sonatype.nexus.quartz.internal.QuartzThreadPool.lambda$0(QuartzThreadPool.java:143)
      	at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
      	at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
      	at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      
      2020-05-25 17:10:05,737-0300 WARN  [blob-store-group-removal-6] *SYSTEM org.sonatype.nexus.blobstore.file.FileBlobStore - File blob store 'morespace' is not writable. Read only: true. Usable space: 123131682816
      2020-05-25 17:10:05,739-0300 ERROR [quartz-7-thread-9] *SYSTEM com.sonatype.nexus.blobstore.group.internal.tasks.BlobStoreGroupMemberRemovalTask - Member removal task did not complete successfully
      java.util.concurrent.ExecutionException: org.sonatype.nexus.blobstore.api.BlobStoreException: Unable to find a member Blob Store of 'BlobStoreGroup$$EnhancerByGuice$$80c34420{name='default',members='[org.sonatype.nexus.blobstore.file.FileBlobStore$$EnhancerByGuice$$7a757826@505d7b68, org.sonatype.nexus.blobstore.file.FileBlobStore$$EnhancerByGuice$$7a757826@73bf9480]'}' for create
      	at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
      	at com.sonatype.nexus.blobstore.group.internal.tasks.BlobStoreGroupMemberRemovalTask.processBlobs(BlobStoreGroupMemberRemovalTask.java:164)
      	at com.sonatype.nexus.blobstore.group.internal.tasks.BlobStoreGroupMemberRemovalTask.execute(BlobStoreGroupMemberRemovalTask.java:126)
      	at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:100)
      	at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:143)
      	at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:106)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.sonatype.nexus.quartz.internal.QuartzThreadPool.lambda$0(QuartzThreadPool.java:145)
      	at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
      	at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
      	at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      
      

      Expected

      The code should use a more reliable check to see if a blobstore path is writable.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Michael Oliverio Michael Oliverio
            Team:
            NXRM - Sentinels
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title