We are using Nexus Repository version 3.2.0-01 and started getting the following error in nexus.log. OrientDB has got corrupted. Nexus is no longer starting.
Deleting the cache folder (/opt/sonatype-work/nexus3/cache) solved the issue for me
The database write ahead logs are corrupt.
Make a backup of $install-dir/sonatype-work/nexus3/db/component
, and then remove files with extension .wal
from that directory. Then try the startup again
if the issue still persist, try clearing all .wal
files under the "DB" directory, will resolve the issue,
I did tried this method and it worked like charm.
regards vinay
We had similar issue with Nexus OSS verison 3.2.0-01 and OrientDB corrupted state because of unclean shutdown.
In our case the corrupted storage was component located in
$install-dir/sonatype-work/nexus3/db/component
2017-04-14 15:09:20,007+0200 ERROR [qtp18266400-74] *UNKNOWN com.google.common.eventbus.EventBus.reentrant - Could not dispatch event AssetUpdatedEvent{metadata=AttachedEntityMetadata{schema=asset, document=asset#18:91856{bucket:#13:3,format:maven2,last_updated:Fri Apr 14 15:09:19 CEST 2017,attributes:[5],component:null,name:org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml,size:743,content_type:application/xml,blob_ref:default@ECF4439E-D7F184F8-578BAB14-ACFC0FB8-5589B163:3fb95745-4aed-460f-b711-b5f5b74b837c,last_accessed:Fri Apr 14 15:09:19 CEST 2017} v466}, remoteNodeId=null} to subscriber org.sonatype.nexus.repository.maven.internal.group.MavenGroupFacet$$EnhancerByGuice$$a88d7327@83eca7 method [public void org.sonatype.nexus.repository.maven.internal.group.MavenGroupFacet.on(org.sonatype.nexus.repository.storage.AssetEvent)]
com.orientechnologies.orient.core.exception.OStorageException: Error during transaction commit
DB name="component"
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.makeRollback(OAbstractPaginatedStorage.java:2210) [na:na]
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:1433) [na:na]
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:539) [com.orientechnologies.orientdb-core:2.2.13]
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:104) [com.orientechnologies.orientdb-core:2.2.13]
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2756) [com.orientechnologies.orientdb-core:2.2.13]
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2725) [com.orientechnologies.orientdb-core:2.2.13]
at org.sonatype.nexus.repository.storage.StorageTxImpl.commit(StorageTxImpl.java:172) [org.sonatype.nexus.repository:3.2.0.01]
at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source) [na:na]
Scheduling Nexus tasks, particullary:
Orient DB manipulation:
According Nexus support you can access Orient DB console with Nexus OSS verison 3.2.1-01. Everything is explained here. Make sure your Nexus application is properly shut down before you apply any operations on database.
Once in Orient DB console you connect to local database with
> CONNECT PLOCAL:${your_install_dir}/sonatype-work/nexus3/db/${database} admin admin
And you perform the following operations:
> REBUILD INDEX *
> REPAIR DATABASE --fix-graph
> REPAIR DATABASE --fix-links
> REPAIR DATABASE --fix-ridbags
> REPAIR DATABASE --fix-bonsai
> DISCONNECT
I am absolutely aware my answer probably won't solve your concrete problem but I still wanted to give you some directions because you don't have any backups.
With Nexus 3.16 there is now a task: Create Repair - Reconcile component database from blob store
super slow, but it helps recreating a accidentally deleted blobstore still on disk.
Just in case that actually matters for somebody else - the above did not help me, but the json export / import one.
In my case nexus runs in the official docker image, so
docker exec -it nexus bash
Or however you access your nexus shell
cd /tmp
/opt/jdk1.8.0_141/bin/java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar
CONNECT plocal:/nexus-data/db/component admin admin
export database component-export
drop database
create database plocal:/nexus-data/db/component
import database component-export.json.gz
In your case the java-path could vary as also the data-path (nexus data) which we use to connect/create the database.
After that, restarting the service and your component database should be up and running again
I had the same mistake:
Cannot open local storage '/nexus-data/db/config' with mode=rw
and when starting the nexus console (java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar
) the following message appeared:
The reason was that Nexus was out of memory and had created some ".wal" files with 0 bytes in the folder "/nexus-data/db/config/". After I deleted them, everything worked again.
Many thanks also to yobert https://gist.github.com/marcelmaatkamp/123e8793e07a72a382d8d0e8d66bbd8f