OrientDB corruption state in Nexus Repository version 3.2.0-01

roopesh picture roopesh · Mar 22, 2017 · Viewed 19k times · Source

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.

Root cause Root cause of this was found to be an unclean shutdown of Nexus because of disk space getting full, this resulted in DB corruption.

2017-03-17 07:09:49,480+0000 WARN  [elasticsearch[A82A95AC-5D396A2B-337B8736-5017E8FC-915232E4][local_transport][T#1]] *SYSTEM org.elasticsearch.cluster.action.shard - [A82A95AC-5D396A2B-337B8736-5017E8FC-915232E4] [cab22f445c1892acef64d17ac2da6d0086023e21][0] received shard failed for [cab22f445c1892acef64d17ac2da6d0086023e21][0], node[HBjARpI7RyqqqruVqEJ8Ig], [P], v[11], s[INITIALIZING], a[id=FmxOHS7nQcGNz_93VlTpKg], unassigned_info[[reason=ALLOCATION_FAILED], at[2017-03-17T07:09:49.101Z], details[failed recovery, failure IndexShardRecoveryException[failed to recovery from gateway]; nested: EngineCreationFailureException[failed to recover from translog]; nested: EngineException[failed to recover from translog]; nested: IndexFailedEngineException[Index failed for [component#36e3dec8de528c9b41c5c6ac3b18e3f7]]; nested: NotSerializableExceptionWrapper[No space left on device]; ]], indexUUID [fLN4hdE8QPKH7Pj5RpLtmw], message [engine failure, reason [index]], failure [NotSerializableExceptionWrapper[No space left on device]]
org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: No space left on device
at sun.nio.ch.FileDispatcherImpl.write0(Native Method) [na:1.8.0_121]
at sun.nio.ch.FileDispatcherImpl.write(FileDispatcherImpl.java:60) [na:1.8.0_121]
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) [na:1.8.0_121]
at sun.nio.ch.IOUtil.write(IOUtil.java:65) [na:1.8.0_121]
at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:211) [na:1.8.0_121]
at org.elasticsearch.common.io.Channels.writeToChannel(Channels.java:211) [na:na]
at org.elasticsearch.common.bytes.PagedBytesReference.writeTo(PagedBytesReference.java:132) [na:na]
at org.elasticsearch.index.translog.BufferingTranslogWriter.add(BufferingTranslogWriter.java:57) [na:na]

No backup We have not backed up Nexus VM, therefore we wont be able to restore it back. What is the possible way out - recreating the database - with least damage. Appreciate any help.

Answer

Eugen Mayer picture Eugen Mayer · Aug 31, 2017

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