Permission denied after starting Nexus 2.14.13-01


#1

I’ve recently installed Nexus 2.14.13-01 on a CentOS machine.
It was working fine a day before, but now I’m getting error mentioned at the end of this post.

I’m currently using ‘nexus’ as the user to operate the repo.
And I’ve also increased the ulimit as suggested here.

bash-4.2$ whoami
nexus
bash-4.2$ ulimit -Hn
65536
bash-4.2$ ulimit -Sn
65536

Please suggest what should I do as it is creating a blocker for me.

Thank you

Error Trace:

jvm 1    | 2019-07-08 09:33:28,571-0400 INFO  [jetty-main-1]  org.sonatype.nexus.NxApplication - Started Nexus Repository Manager OSS 2.14.13-01
jvm 1    | 2019-07-08 09:33:29,058-0400 WARN  [ar-7-thread-2] *TASK org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable - MandubianMvn A
R-Updater failed:
jvm 1    | java.lang.RuntimeException: org.sonatype.nexus.proxy.LocalStorageException: Permission denied

jvm 1    | 2019-07-08 09:33:28,571-0400 INFO  [jetty-main-1]  org.sonatype.nexus.NxApplication - Started Nexus Repository Manager OSS 2.14.13-01
jvm 1    | 2019-07-08 09:33:29,058-0400 WARN  [ar-7-thread-2] *TASK org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable - MandubianMvn A
R-Updater failed:
jvm 1    | java.lang.RuntimeException: org.sonatype.nexus.proxy.LocalStorageException: Permission denied
jvm 1    |      at com.google.common.base.Throwables.propagate(Throwables.java:160)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable.doRun(UpdateRepositoryRunnable.java:71)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.task.RunnableSupport.run(RunnableSupport.java:58)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.task.CancelableRunnableSupport.run(CancelableRunnableSupport.java:72)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.task.executor.ConstrainedExecutorImpl$CancelableRunnableWrapper.run(ConstrainedExecutorImp
l.java:174)
jvm 1    |      at org.sonatype.nexus.threads.MDCAwareRunnable.run(MDCAwareRunnable.java:41)
jvm 1    |      at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
jvm 1    |      at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
jvm 1    |      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
jvm 1    |      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
jvm 1    |      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
jvm 1    |      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
jvm 1    |      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
jvm 1    |      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
jvm 1    |      at java.lang.Thread.run(Thread.java:748)
jvm 1    | Caused by: org.sonatype.nexus.proxy.LocalStorageException: Permission denied
jvm 1    |      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.getHiddenTarget(DefaultFSPeer.java:353)
jvm 1    |      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.storeItem(DefaultFSPeer.java:169)
jvm 1    |      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSLocalRepositoryStorage.storeItem(DefaultFSLocalRepositoryStorage.java:390)
jvm 1    |      at org.sonatype.nexus.proxy.repository.AbstractRepository.storeItem(AbstractRepository.java:1015)
jvm 1    |      at org.sonatype.nexus.proxy.maven.AbstractMavenRepository.storeItem(AbstractMavenRepository.java:466)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.PropfileDiscoveryStatusSource.putFileItem(PropfileDiscoveryStatusSource.java:181)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.PropfileDiscoveryStatusSource.write(PropfileDiscoveryStatusSource.java:128)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl.updateProxyPrefixFile(ManagerImpl.java:565)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl.updateAndPublishPrefixFile(ManagerImpl.java:510)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable.doRun(UpdateRepositoryRunnable.java:61)
jvm 1    |      ... 13 common frames omitted
jvm 1    | Caused by: java.io.IOException: Permission denied
jvm 1    |      at java.io.UnixFileSystem.createFileExclusively(Native Method)
jvm 1    |      at java.io.File.createTempFile(File.java:2024)
jvm 1    |      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.getHiddenTarget(DefaultFSPeer.java:350)
jvm 1    |      ... 22 common frames omitted
jvm 1    | 2019-07-08 09:33:29,077-0400 WARN  [ar-7-thread-3] *TASK org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable - SpringSourceExternal AR-Updater failed:
jvm 1    | java.lang.RuntimeException: org.sonatype.nexus.proxy.LocalStorageException: Permission denied
jvm 1    |      at com.google.common.base.Throwables.propagate(Throwables.java:160)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable.doRun(UpdateRepositoryRunnable.java:71)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.task.RunnableSupport.run(RunnableSupport.java:58)
:
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.task.CancelableRunnableSupport.run(CancelableRunnableSupport.java:72)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.task.executor.ConstrainedExecutorImpl$CancelableRunnableWrapper.run(ConstrainedExecutorImpl.java:174)
jvm 1    |      at org.sonatype.nexus.threads.MDCAwareRunnable.run(MDCAwareRunnable.java:41)
jvm 1    |      at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
jvm 1    |      at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
jvm 1    |      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
jvm 1    |      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
jvm 1    |      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
jvm 1    |      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
jvm 1    |      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
jvm 1    |      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
jvm 1    |      at java.lang.Thread.run(Thread.java:748)
jvm 1    | Caused by: org.sonatype.nexus.proxy.LocalStorageException: Permission denied
jvm 1    |      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.getHiddenTarget(DefaultFSPeer.java:353)
jvm 1    |      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.storeItem(DefaultFSPeer.java:169)
jvm 1    |      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSLocalRepositoryStorage.storeItem(DefaultFSLocalRepositoryStorage.java:390)
jvm 1    |      at org.sonatype.nexus.proxy.repository.AbstractRepository.storeItem(AbstractRepository.java:1015)
jvm 1    |      at org.sonatype.nexus.proxy.maven.AbstractMavenRepository.storeItem(AbstractMavenRepository.java:466)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.PropfileDiscoveryStatusSource.putFileItem(PropfileDiscoveryStatusSource.java:181)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.PropfileDiscoveryStatusSource.write(PropfileDiscoveryStatusSource.java:128)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl.updateProxyPrefixFile(ManagerImpl.java:565)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.ManagerImpl.updateAndPublishPrefixFile(ManagerImpl.java:510)
jvm 1    |      at org.sonatype.nexus.proxy.maven.routing.internal.UpdateRepositoryRunnable.doRun(UpdateRepositoryRunnable.java:61)
jvm 1    |      ... 13 common frames omitted
jvm 1    | Caused by: java.io.IOException: Permission denied
jvm 1    |      at java.io.UnixFileSystem.createFileExclusively(Native Method)
jvm 1    |      at java.io.File.createTempFile(File.java:2024)
jvm 1    |      at org.sonatype.nexus.proxy.storage.local.fs.DefaultFSPeer.getHiddenTarget(DefaultFSPeer.java:350)
jvm 1    |      ... 22 common frames omitted

#2

Nexus can’t create a file in the work directory. This likely happened because it was mistakenly run as root user. Try running "chown -R nexus " against the work and installation directories.

Rich


#3

Thanks that helped.