org.sonatype.nexus.proxy.LocalStorageException: Cannot list directory in repository M2Repository(id=releases), path /app/nexus-testing/2.8.0-02/nexus-professional-2.8.0-02-bundle/sonatype-work/nexus/storage/releases/com/sonatype/sample

Sonatype JIRA | Peter Lynch | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    1. Add content to releases repo at least 4 levels deep. Example com/sonatype/sample/project 2. While Nexus is stopped -- delete any storage/releases/.meta/prefixes.txt in storage directories -- cd storage/releases/com/sonatype; chmod go-rx sample; sudo chown -R root sample; 3. Start Nexus with DEBUG enabled. Auto routing threads try to regenerate the prefixes file for the releases repo. You will see what appears a problem trying to inspect directories more than 2 levels deep. {noformat} 2014-04-01 15:37:25,546-0300 WARN [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.walker.DefaultWalker - Aborted walking on repository "Releases" [id=releases] from path "/", cause: Cannot list directory in repository M2Repository(id=releases), path /app/nexus-testing/2.8.0-02/nexus-professional-2.8.0-02-bundle/sonatype-work/nexus/storage/releases/com/sonatype/sample org.sonatype.nexus.proxy.LocalStorageException: Cannot list directory in repository M2Repository(id=releases), path /app/nexus-testing/2.8.0-02/nexus-professional-2.8.0-02-bundle/sonatype-work/nexus/storage/releases/com/sonatype/sample at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.listItems(DefaultFSPeer.java:281) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSLocalRepositoryStorage.listItems(DefaultFSLocalRepositoryStorage.java:423) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.repository.AbstractRepository.doListItems(AbstractRepository.java:1222) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.maven.AbstractMavenRepository.doListItems(AbstractMavenRepository.java:505) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.repository.AbstractRepository.list(AbstractRepository.java:1066) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:206) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:225) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:225) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:225) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.walker.DefaultWalker.walk(DefaultWalker.java:89) ~[nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.maven.routing.internal.LocalContentDiscovererImpl.discoverLocalContent(LocalContentDiscovererImpl.java:87) [nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl.updateHostedPrefixFile(ManagerImpl.java:637) [nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl.updateAndPublishPrefixFile(ManagerImpl.java:513) [nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable.doRun(UpdateRepositoryRunnable.java:61) [nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.maven.routing.internal.task.RunnableSupport.run(RunnableSupport.java:58) [nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.maven.routing.internal.task.CancelableRunnableSupport.run(CancelableRunnableSupport.java:72) [nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.proxy.maven.routing.internal.task.executor.ConstrainedExecutorImpl$CancelableRunnableWrapper.run(ConstrainedExecutorImpl.java:174) [nexus-core-2.8.0-02.jar:2.8.0-02] at org.sonatype.nexus.threads.MDCAwareRunnable.run(MDCAwareRunnable.java:41) [nexus-core-2.8.0-02.jar:2.8.0-02] at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.2.jar:1.2.2] at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.2.jar:1.2.2] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0] at java.lang.Thread.run(Thread.java:744) [na:1.8.0] {noformat} Repeat the procedure this time allowing access to com/sonatype/sample but not com/sonatype/sample/project. Prefix file generation succeeds now. {noformat} 15:50:42,354-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - releases retrieveItem() :: FOUND releases:/ 2014-04-01 15:50:42,354-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - releases.list() :: releases:/ 2014-04-01 15:50:42,355-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.attributes.DefaultLSAttributeStorage - Loading attributes on UID=releases:/archetype-catalog.xml 2014-04-01 15:50:42,357-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - releases.list() :: releases:/com 2014-04-01 15:50:42,357-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - releases.list() :: releases:/com/sonatype 2014-04-01 15:50:42,358-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - releases.list() :: releases:/com/sonatype/sample 2014-04-01 15:50:42,358-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.walker.DefaultWalker - Finished walking on ResourceStore 'releases' from path '/'. 2014-04-01 15:50:42,358-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - releases.retrieveItem() :: ResourceStoreRequest{requestPath='/.meta/prefixes.txt', requestContext=RequestContext{this=org.sonatype.nexus.proxy.RequestContext@726e1dec, parent=null}, pathStack=[], processedRepositories=[], appliedMappings={}} 2014-04-01 15:50:42,358-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - ResourceStoreRequest{requestPath='/.meta/prefixes.txt', requestContext=RequestContext{this=org.sonatype.nexus.proxy.RequestContext@726e1dec, parent=null}, pathStack=[], processedRepositories=[releases], appliedMappings={}} :: localOnly=true, remoteOnly=false, asExpired=false 2014-04-01 15:50:42,358-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - Item ResourceStoreRequest{requestPath='/.meta/prefixes.txt', requestContext=RequestContext{this=org.sonatype.nexus.proxy.RequestContext@726e1dec, parent=null}, pathStack=[], processedRepositories=[releases], appliedMappings={}} not found in local storage. 2014-04-01 15:50:42,358-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - releases retrieveItem() :: NOT FOUND releases:/.meta/prefixes.txt 2014-04-01 15:50:42,359-0300 INFO [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl - Updated and published prefix file of "Releases" [id=releases] 2014-04-01 15:50:42,359-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.maven.maven2.M2Repository - releases.storeItem() :: releases:/.meta/prefixes.txt 2014-04-01 15:50:42,359-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer - Storing file to /app/nexus-testing/2.8.0-02/nexus-professional-2.8.0-02-bundle/sonatype-work/nexus/storage/releases/.meta/prefixes.txt 2014-04-01 15:50:42,360-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.attributes.DefaultLSAttributeStorage - Storing attributes on UID=releases:/.meta/prefixes.txt 2014-04-01 15:50:42,360-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer - Storing file to /app/nexus-testing/2.8.0-02/nexus-professional-2.8.0-02-bundle/sonatype-work/nexus/storage/releases/.nexus/attributes/.meta/prefixes.txt 2014-04-01 15:50:42,361-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.sisu.goodies.eventbus.internal.DefaultEventBus - Event 'RepositoryItemEventStoreCreate(sender="Releases" [id=releases], releases:/.meta/prefixes.txt)' fired 2014-04-01 15:50:42,362-0300 DEBUG [ar-4-thread-2] *SYSTEM org.sonatype.sisu.goodies.eventbus.internal.DefaultEventBus - Event 'PrefixFilePublishedRepositoryEvent{repositoryId=releases}' fired 2014-04-01 {noformat}

    Sonatype JIRA | 3 years ago | Peter Lynch
    org.sonatype.nexus.proxy.LocalStorageException: Cannot list directory in repository M2Repository(id=releases), path /app/nexus-testing/2.8.0-02/nexus-professional-2.8.0-02-bundle/sonatype-work/nexus/storage/releases/com/sonatype/sample

    Root Cause Analysis

    1. org.sonatype.nexus.proxy.LocalStorageException

      Cannot list directory in repository M2Repository(id=releases), path /app/nexus-testing/2.8.0-02/nexus-professional-2.8.0-02-bundle/sonatype-work/nexus/storage/releases/com/sonatype/sample

      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.listItems()
    2. ${project.groupId}:${project.artifactId}
      MDCAwareRunnable.run
      1. org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.listItems(DefaultFSPeer.java:281)[nexus-core-2.8.0-02.jar:2.8.0-02]
      2. org.sonatype.nexus.proxy.storage.local.fs.DefaultFSLocalRepositoryStorage.listItems(DefaultFSLocalRepositoryStorage.java:423)[nexus-core-2.8.0-02.jar:2.8.0-02]
      3. org.sonatype.nexus.proxy.repository.AbstractRepository.doListItems(AbstractRepository.java:1222)[nexus-core-2.8.0-02.jar:2.8.0-02]
      4. org.sonatype.nexus.proxy.maven.AbstractMavenRepository.doListItems(AbstractMavenRepository.java:505)[nexus-core-2.8.0-02.jar:2.8.0-02]
      5. org.sonatype.nexus.proxy.repository.AbstractRepository.list(AbstractRepository.java:1066)[nexus-core-2.8.0-02.jar:2.8.0-02]
      6. org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:206)[nexus-core-2.8.0-02.jar:2.8.0-02]
      7. org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:225)[nexus-core-2.8.0-02.jar:2.8.0-02]
      8. org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:225)[nexus-core-2.8.0-02.jar:2.8.0-02]
      9. org.sonatype.nexus.proxy.walker.DefaultWalker.walkRecursive(DefaultWalker.java:225)[nexus-core-2.8.0-02.jar:2.8.0-02]
      10. org.sonatype.nexus.proxy.walker.DefaultWalker.walk(DefaultWalker.java:89)[nexus-core-2.8.0-02.jar:2.8.0-02]
      11. org.sonatype.nexus.proxy.maven.routing.internal.LocalContentDiscovererImpl.discoverLocalContent(LocalContentDiscovererImpl.java:87)[nexus-core-2.8.0-02.jar:2.8.0-02]
      12. org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl.updateHostedPrefixFile(ManagerImpl.java:637)[nexus-core-2.8.0-02.jar:2.8.0-02]
      13. org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl.updateAndPublishPrefixFile(ManagerImpl.java:513)[nexus-core-2.8.0-02.jar:2.8.0-02]
      14. org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable.doRun(UpdateRepositoryRunnable.java:61)[nexus-core-2.8.0-02.jar:2.8.0-02]
      15. org.sonatype.nexus.proxy.maven.routing.internal.task.RunnableSupport.run(RunnableSupport.java:58)[nexus-core-2.8.0-02.jar:2.8.0-02]
      16. org.sonatype.nexus.proxy.maven.routing.internal.task.CancelableRunnableSupport.run(CancelableRunnableSupport.java:72)[nexus-core-2.8.0-02.jar:2.8.0-02]
      17. org.sonatype.nexus.proxy.maven.routing.internal.task.executor.ConstrainedExecutorImpl$CancelableRunnableWrapper.run(ConstrainedExecutorImpl.java:174)[nexus-core-2.8.0-02.jar:2.8.0-02]
      18. org.sonatype.nexus.threads.MDCAwareRunnable.run(MDCAwareRunnable.java:41)[nexus-core-2.8.0-02.jar:2.8.0-02]
      18 frames
    3. Shiro
      SubjectRunnable.run
      1. org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)[shiro-core-1.2.2.jar:1.2.2]
      2. org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)[shiro-core-1.2.2.jar:1.2.2]
      2 frames
    4. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[na:1.8.0]
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0]
      3. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0]
      4. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[na:1.8.0]
      5. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0]
      6. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0]
      7. java.lang.Thread.run(Thread.java:744)[na:1.8.0]
      7 frames