Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.io.FileNotFoundException: /sonatype-work/nexus.lock (Permission denied) #5

Open
cmoulliard opened this issue Apr 25, 2017 · 7 comments

Comments

@cmoulliard
Copy link

Commands used

oc login -u system:admin
oadm policy add-cluster-role-to-user cluster-admin developer
oc login -u developer -p developer

oc project repo

oc create -f /Users/chmoulli/Code/jboss/obsidian-toaster/nexus-pv.yaml
oc create -f /Users/chmoulli/Code/jboss/obsidian-toaster/nexus-pvc.yaml

# oc create -f https://raw.githubusercontent.com/OpenShiftDemos/nexus/master/nexus2-template.yaml
oc create -f https://raw.githubusercontent.com/OpenShiftDemos/nexus/master/nexus2-persistent-template.yaml
oc new-app nexus2-persistent

where

nexus-pvc -->

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nexus-pv
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

and nexus pv

apiVersion: v1
kind: PersistentVolume
metadata:
  name: nexus-storage-pv
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: nexus-pv
  hostPath:
    path: /data/launch/nexus-storage
  persistentVolumeReclaimPolicy: Recycle

Error

2017-04-25 06:57:10,625+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder - Properties:
2017-04-25 06:57:10,632+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   application-conf='/sonatype-work/conf'
2017-04-25 06:57:10,635+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   application-host='0.0.0.0'
2017-04-25 06:57:10,635+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   application-port='8081'
2017-04-25 06:57:10,635+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   bundleBasedir='/opt/sonatype/nexus'
2017-04-25 06:57:10,635+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   java.awt.headless='true'
2017-04-25 06:57:10,635+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   networkaddress.cache.ttl='3600'
2017-04-25 06:57:10,635+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   nexus-app='/opt/sonatype/nexus/nexus/WEB-INF'
2017-04-25 06:57:10,635+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   nexus-webapp='/opt/sonatype/nexus/nexus'
2017-04-25 06:57:10,635+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   nexus-webapp-context-path='/'
2017-04-25 06:57:10,636+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   nexus-work='/sonatype-work'
2017-04-25 06:57:10,636+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   org.eclipse.ecf.provider.filetransfer.retrieve.readTimeout='30000'
2017-04-25 06:57:10,636+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   runtime='/opt/sonatype/nexus/nexus/WEB-INF'
2017-04-25 06:57:10,636+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   security-xml-file='/sonatype-work/conf/security.xml'
2017-04-25 06:57:10,637+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   storage.diskCache.bufferSize='4096'
2017-04-25 06:57:10,637+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - Java: 1.8.0_102, Java HotSpot(TM) 64-Bit Server VM, Oracle Corporation, 25.102-b14
2017-04-25 06:57:10,637+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - OS: Linux, 4.4.27-boot2docker, amd64
2017-04-25 06:57:10,638+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - User: ?, en, ?
2017-04-25 06:57:10,638+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - CWD: /opt/sonatype/nexus
2017-04-25 06:57:10,675+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - TMP: /tmp
2017-04-25 06:57:10,679+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Starting
2017-04-25 06:57:10,699+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Applying configuration: file:/opt/sonatype/nexus/conf/jetty.xml
2017-04-25 06:57:10,967+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Applying configuration: file:/opt/sonatype/nexus/conf/jetty-requestlog.xml
2017-04-25 06:57:10,988+0000 INFO  [jetty-main-1] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Starting: org.eclipse.jetty.server.Server@53fdbc
2017-04-25 06:57:10,992+0000 INFO  [jetty-main-1] *SYSTEM org.eclipse.jetty.server.Server - jetty-8.1.16.v20140903
2017-04-25 06:57:11,591+0000 INFO  [jetty-main-1] *SYSTEM org.sonatype.nexus.webapp.WebappBootstrap - Initializing
2017-04-25 06:57:11,592+0000 INFO  [jetty-main-1] *SYSTEM org.sonatype.nexus.webapp.WebappBootstrap - Using bootstrap launcher configuration
2017-04-25 06:57:11,604+0000 WARN  [jetty-main-1] *SYSTEM org.sonatype.nexus.util.LockFile - Failed to write lock file
java.io.FileNotFoundException: /sonatype-work/nexus.lock (Permission denied)
	at java.io.RandomAccessFile.open0(Native Method) ~[na:1.8.0_102]
	at java.io.RandomAccessFile.open(RandomAccessFile.java:316) ~[na:1.8.0_102]
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243) ~[na:1.8.0_102]
	at org.sonatype.nexus.util.LockFile.lock(LockFile.java:92) ~[nexus-core-2.14.2-01.jar:2.14.2-01]
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117) [classes/:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
2017-04-25 06:57:11,605+0000 ERROR [jetty-main-1] *SYSTEM org.sonatype.nexus.webapp.WebappBootstrap - Failed to initialize
java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200) ~[guava-16.0.1.jar:na]
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117) ~[classes/:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
2017-04-25 06:57:11,607+0000 WARN  [jetty-main-1] *SYSTEM org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext{/,file:/opt/sonatype/nexus/nexus/},/opt/sonatype/nexus/nexus
java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200) ~[na:na]
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
2017-04-25 06:57:11,608+0000 WARN  [jetty-main-1] *SYSTEM org.eclipse.jetty.util.component.AbstractLifeCycle - FAILED o.e.j.w.WebAppContext{/,file:/opt/sonatype/nexus/nexus/},/opt/sonatype/nexus/nexus: java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200) ~[na:na]
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
2017-04-25 06:57:11,608+0000 WARN  [jetty-main-1] *SYSTEM org.eclipse.jetty.util.component.AbstractLifeCycle - FAILED com.yammer.metrics.jetty.InstrumentedHandler@5c1ea8c1: java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200) ~[na:na]
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
2017-04-25 06:57:11,652+0000 WARN  [jetty-main-1] *SYSTEM org.eclipse.jetty.util.component.AbstractLifeCycle - FAILED org.eclipse.jetty.server.handler.HandlerCollection@3652e2c0: java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200) ~[na:na]
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
2017-04-25 06:57:11,653+0000 WARN  [jetty-main-1] *SYSTEM org.eclipse.jetty.util.component.AbstractLifeCycle - FAILED org.eclipse.jetty.server.Server@53fdbc: java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200) ~[na:na]
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.Server.doStart(Server.java:282) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
2017-04-25 06:57:11,653+0000 INFO  [jetty-main-1] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Running
2017-04-25 06:57:11,655+0000 ERROR [main] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Start failed
java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200) ~[na:na]
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) ~[jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) ~[jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.server.Server.doStart(Server.java:282) ~[jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) ~[nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
Exception in thread "main" java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200)
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
	at org.eclipse.jetty.server.Server.doStart(Server.java:282)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247)
@thepolina
Copy link

Same issue +1

@thepolina
Copy link

UPD: I'm runnung it in docker container so this workaround actually worked for me https://stackoverflow.com/questions/36405434/sonatype-nexus-docker-volume-error

@waterdrops
Copy link

waterdrops commented Aug 7, 2017

Docker Version

Client:
 Version:         1.12.6
 API version:     1.24
 Package version: docker-1.12.6-28.git1398f24.el7.centos.x86_64
 Go version:      go1.7.4
 Git commit:      1398f24/1.12.6
 Built:           Fri May 26 17:28:18 2017
 OS/Arch:         linux/amd64

Server:
 Version:         1.12.6
 API version:     1.24
 Package version: docker-1.12.6-28.git1398f24.el7.centos.x86_64
 Go version:      go1.7.4
 Git commit:      1398f24/1.12.6
 Built:           Fri May 26 17:28:18 2017
 OS/Arch:         linux/amd64

Docker info

Containers: 4
 Running: 4
 Paused: 0
 Stopped: 0
Images: 19
Server Version: 1.12.6
Storage Driver: devicemapper
 Pool Name: docker-8:5-805306432-pool
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /data/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /data/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.135-RHEL7 (2016-11-16)
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
 Volume: local
 Network: bridge null host overlay
Swarm: inactive
Runtimes: docker-runc runc
Default Runtime: docker-runc
Security Options: seccomp selinux
Kernel Version: 3.10.0-327.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 2
Name: NAME
ID: U5WP:5CI7:Y74O:ELGH:RRCC:6SJU:B63A:TWI3:SHFQ:UD5C:BS7Z:Y5QG
Docker Root Dir: /data/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:
 127.0.0.0/8
Registries: docker.io (secure)

Error Messages

2017-08-07 07:51:55,517+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder - Properties:
2017-08-07 07:51:55,518+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   application-conf='/sonatype-work/conf'
2017-08-07 07:51:55,519+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   application-host='0.0.0.0'
2017-08-07 07:51:55,519+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   application-port='8081'
2017-08-07 07:51:55,519+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   bundleBasedir='/opt/sonatype/nexus'
2017-08-07 07:51:55,519+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   java.awt.headless='true'
2017-08-07 07:51:55,519+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   networkaddress.cache.ttl='3600'
2017-08-07 07:51:55,519+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   nexus-app='/opt/sonatype/nexus/nexus/WEB-INF'
2017-08-07 07:51:55,520+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   nexus-webapp='/opt/sonatype/nexus/nexus'
2017-08-07 07:51:55,520+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   nexus-webapp-context-path='/nexus'
2017-08-07 07:51:55,520+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   nexus-work='/sonatype-work'
2017-08-07 07:51:55,520+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   org.eclipse.ecf.provider.filetransfer.retrieve.readTimeout='30000'
2017-08-07 07:51:55,520+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   runtime='/opt/sonatype/nexus/nexus/WEB-INF'
2017-08-07 07:51:55,520+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   security-xml-file='/sonatype-work/conf/security.xml'
2017-08-07 07:51:55,520+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder -   storage.diskCache.bufferSize='4096'
2017-08-07 07:51:55,520+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - Java: 1.8.0_141, Java HotSpot(TM) 64-Bit Server VM, Oracle Corporation, 25.141-b15
2017-08-07 07:51:55,521+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - OS: Linux, 3.10.0-327.el7.x86_64, amd64
2017-08-07 07:51:55,521+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - User: nexus, en, /sonatype-work
2017-08-07 07:51:55,521+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - CWD: /opt/sonatype/nexus
2017-08-07 07:51:55,539+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.Launcher - TMP: /tmp
2017-08-07 07:51:55,540+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Starting
2017-08-07 07:51:55,547+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Applying configuration: file:/opt/sonatype/nexus/conf/jetty.xml
2017-08-07 07:51:55,722+0000 INFO  [main] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Applying configuration: file:/opt/sonatype/nexus/conf/jetty-requestlog.xml
2017-08-07 07:51:55,732+0000 INFO  [jetty-main-1]  org.sonatype.nexus.bootstrap.jetty.JettyServer - Starting: org.eclipse.jetty.server.Server@44635db3
2017-08-07 07:51:55,736+0000 INFO  [jetty-main-1]  org.eclipse.jetty.server.Server - jetty-8.1.16.v20140903
2017-08-07 07:51:56,263+0000 INFO  [jetty-main-1]  org.sonatype.nexus.webapp.WebappBootstrap - Initializing
2017-08-07 07:51:56,263+0000 INFO  [jetty-main-1]  org.sonatype.nexus.webapp.WebappBootstrap - Using bootstrap launcher configuration
2017-08-07 07:51:56,270+0000 WARN  [jetty-main-1]  org.sonatype.nexus.util.LockFile - Failed to write lock file
java.io.FileNotFoundException: /sonatype-work/nexus.lock (Permission denied)
	at java.io.RandomAccessFile.open0(Native Method)
	at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
	at org.sonatype.nexus.util.LockFile.lock(LockFile.java:92)
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
	at org.eclipse.jetty.server.Server.doStart(Server.java:282)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247)
2017-08-07 07:51:56,270+0000 ERROR [jetty-main-1]  org.sonatype.nexus.webapp.WebappBootstrap - Failed to initialize
java.lang.IllegalStateException: Nexus work directory already in use: /sonatype-work
	at com.google.common.base.Preconditions.checkState(Preconditions.java:200)
	at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
	at org.eclipse.jetty.server.Server.doStart(Server.java:282)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247)

self-define docker-compose yml

version: '2'

services:
  nexus:
    restart: always
    #image: sonatype/nexus
    image: sonatype/nexus:2.14.5-02
    ports:
    - 8081:8081
    volumes:
    - /data/sonatype-work:/sonatype-work
    environment:
    - MAX_HEAP=1024m
    - MIN_HEAP=1024m

temporary solution

version: '2'

services:
  nexus:
    restart: always
    #image: sonatype/nexus
    image: sonatype/nexus:2.14.5-02
    ports:
    - 8081:8081
    volumes:
    - /data/sonatype-work:/sonatype-work:Z
    environment:
    - MAX_HEAP=1024m
    - MIN_HEAP=1024m

Volume labels

reference

Labeling systems like SELinux require that proper labels are placed on volume content mounted into a container. Without a label, the security system might prevent the processes running inside the container from using the content. By default, Docker does not change the labels set by the OS.

To change a label in the container context, you can add either of two suffixes :z or :Z to the volume mount. These suffixes tell Docker to relabel file objects on the shared volumes. The z option tells Docker that two containers share the volume content. As a result, Docker labels the content with a shared content label. Shared volume labels allow all containers to read/write content. The Z option tells Docker to label the content with a private unshared label. Only the current container can use a private volume.

@flefevre
Copy link

I have created the following volume with cockpit
Volumes: /data/docker/nexus3/nexus-data:/nexus-data:rw
/data/docker/nexus3/sonatype-work/:/sonatype-work:rw

@namloc2001
Copy link

We saw java errors and overcame them with the following:

For us, running on OpenShift, we got it working by using:

spec:
  template:
    spec:
        securityContext:
           fsGroup: 200

(And then had to ensure our serviceAccount was permitted to use this ID via the appropriate SCC).

We also tried using 'fsGroup: 2000', however we got errors in the logs:

2020-06-05 11:58:31,930+0000 ERROR [main] *SYSTEM com.sonatype.insight.brain.service.NewInstancePopulator - Unable to import Reference Policies from HDS
org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.  See the nested exceptions for details on the errors that occurred.
        at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2470)
        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2308)
..........
Suppressed: org.apache.openjpa.persistence.PersistenceException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-196]
                at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5250)
                at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:5210)
                at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:134)
                at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:107)
                at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:59)
.........
        Caused by: org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-196]
                at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
                ... 23 common frames omitted
............
Caused by: org.apache.openjpa.persistence.PersistenceException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-196]
        at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5250)

@yorammi
Copy link

yorammi commented Jan 26, 2021

I've got similar issue this week and the solution where to run 'chown -R nexus:nexus' for the data folder. Seems that something changed the owner of one or more files to be root or different than 'nexus'

@glennodickson
Copy link

glennodickson commented Jan 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants