Problem
In Nexus Repository 3 when using OrientDB the startup may fail with the following type of error in the nexus.log.
javax.validation.ConstraintViolationException: attributes.storage.blobStoreName: Blob Store 'default' does not exist
2021-08-17 22:55:13,115+0400 ERROR [FelixStartLevel] *SYSTEM org.sonatype.nexus.extender.NexusContextListener - Failed to start nexus
javax.validation.ConstraintViolationException: attributes.storage.blobStoreName: Blob Store 'default' does not exist
at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:174)
at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.newRepository(RepositoryManagerImpl.java:193)
at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.restoreRepositories(RepositoryManagerImpl.java:270)
at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.doStart(RepositoryManagerImpl.java:252)
at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:69)
at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:193)
at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:57)
at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:199)
at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:111)
at org.sonatype.nexus.extender.NexusContextListener.moveToPhase(NexusContextListener.java:319)
at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:216)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1597)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.lang.Thread.run(Thread.java:748)
2021-08-17 22:55:13,118+0400 ERROR [FelixStartLevel] *SYSTEM Felix - Framework listener delivery error.
javax.validation.ConstraintViolationException: attributes.storage.blobStoreName: Blob Store 'default' does not exist
at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:174)
at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.newRepository(RepositoryManagerImpl.java:193)
at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.restoreRepositories(RepositoryManagerImpl.java:270)
at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.doStart(RepositoryManagerImpl.java:252)
at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:69)
at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:193)
at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:57)
at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:199)
at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:111)
at org.sonatype.nexus.extender.NexusContextListener.moveToPhase(NexusContextListener.java:319)
at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:216)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1597)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
Diagnosis
The error indicates that a repository exists in the configuration database that references a blobstore which does not exist in the database. This can be caused by triggering known bug NEXUS-12492 or NEXUS-27708.
This can most commonly happen when the "default" file-based blobstore has been deleted because other blobstore types ( S3 for example ) have been configured instead. Nexus Repository 3 will not start in this state to help protect the instance from booting with an invalid internal state.
Solution
To resolve this, you'll need to connect to the OrientDB config database from the command line and insert back a database record for the blobstore.
Assuming you need to recreate the default file-based blobstore record in the database and the install directory is /opt/nexus-3.33.0-01/
and the data directory is /nexus/sonatype-work/nexus3/
then:
-
Create the blobstore directory if it doesn't exist and ensure the owner is the nexus process user.
mkdir /nexus/sonatype-work/nexus3/blobs/default
-
In a terminal as the nexus user change directories to the installation dir
cd /opt/nexus-3.33.0-01/
-
Connect to the orient db console using the same java executable that the Nexus Repository server uses - example:
java -jar lib/support/nexus-orient-console.jar
-
At the prompt, type and press return after each of the following commands.
connect plocal:/nexus/sonatype-work/nexus3/db/config admin admin insert into repository_blobstore (name, type, attributes) values ('default', 'File', {'file': {'path': 'default'}}) disconnect exit
- After being disconnected from the console, then try to start Nexus Repository 3 as you normally would.