Unable to upgrade Nexus from version OSS 3.30.1-01 to 3.31.0

Hello,

I’ve been trying to upgrade the nexus version from version OSS 3.30.1-01 to 3.31.0 in a rhel 7.9 server but it appears the following log error related to the repository:

2021-06-29 18:07:10,357+0200 WARN [quartz-11-thread-1] *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskJob - Task 4d8df02d-6121-4f10-a3ed-cfbb375499e5 : ‘Repair - Rebuild repository search’ [repository.rebuild-index] execution failure
org.sonatype.goodies.common.MultipleFailures$MultipleFailuresException: Failed to run task ‘Rebuilding search index of *’; 3 failures
at org.sonatype.goodies.common.MultipleFailures.maybePropagate(MultipleFailures.java:95)
at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:90)
at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:100)
at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:143)
at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:106)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.sonatype.nexus.quartz.internal.QuartzThreadPool.lambda$0(QuartzThreadPool.java:145)
at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Suppressed: org.sonatype.nexus.common.stateguard.InvalidStateException: Invalid state: STOPPED; allowed: [STARTED]
at org.sonatype.nexus.common.stateguard.StateGuard._ensure(StateGuard.java:115)
at org.sonatype.nexus.common.stateguard.StateGuard.access$1(StateGuard.java:108)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:271)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
at org.sonatype.nexus.repository.search.index.RebuildIndexTask.execute(RebuildIndexTask.java:33)
at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:79)
… 13 common frames omitted
Suppressed: org.sonatype.nexus.common.stateguard.InvalidStateException: Invalid state: STOPPED; allowed: [STARTED]
at org.sonatype.nexus.common.stateguard.StateGuard._ensure(StateGuard.java:115)
at org.sonatype.nexus.common.stateguard.StateGuard.access$1(StateGuard.java:108)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:271)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
at org.sonatype.nexus.repository.search.SearchFacetImpl.rebuildIndex(SearchFacetImpl.java:113)
at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
at org.sonatype.nexus.repository.search.index.RebuildIndexTask.execute(RebuildIndexTask.java:33)
at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:79)
… 13 common frames omitted
Suppressed: org.sonatype.nexus.common.stateguard.InvalidStateException: Invalid state: STOPPED; allowed: [STARTED]
at org.sonatype.nexus.common.stateguard.StateGuard._ensure(StateGuard.java:115)
at org.sonatype.nexus.common.stateguard.StateGuard.access$1(StateGuard.java:108)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:271)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
at org.sonatype.nexus.repository.search.SearchFacetImpl.rebuildIndex(SearchFacetImpl.java:113)
at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
at org.sonatype.nexus.repository.search.index.RebuildIndexTask.execute(RebuildIndexTask.java:33)
at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:79)
… 13 common frames omitted
2021-06-29 18:07:10,358+0200 INFO [quartz-11-thread-1] *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task ‘Repair - Rebuild repository search’ [repository.rebuild-index] state change RUNNING → OK
2021-06-29 18:07:10,359+0200 ERROR [quartz-11-thread-1] *SYSTEM org.quartz.core.ErrorLogger - Unable to notify JobListener(s) of Job that was executed: (error will be ignored). trigger= DEFAULT.6da64b5bd2ee-3b31ca06-ce5e-4850-bd31-29a6088e99e3 job= nexus.db593ebf-8d7d-4a00-930b-c29e35d4dd54
org.quartz.SchedulerException: JobListener ‘org.sonatype.nexus.quartz.internal.task.QuartzTaskJobListener:nexus.db593ebf-8d7d-4a00-930b-c29e35d4dd54’ threw exception: Invalid state: STOPPED; allowed: [STARTED]
at org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1969)
at org.quartz.core.JobRunShell.notifyJobListenersComplete(JobRunShell.java:340)
at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
at org.sonatype.nexus.quartz.internal.QuartzThreadPool.lambda$0(QuartzThreadPool.java:145)
at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.sonatype.nexus.common.stateguard.InvalidStateException: Invalid state: STOPPED; allowed: [STARTED]
at org.sonatype.nexus.common.stateguard.StateGuard._ensure(StateGuard.java:115)
at org.sonatype.nexus.common.stateguard.StateGuard.access$1(StateGuard.java:108)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:271)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
at org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo.setNexusTaskState(QuartzTaskInfo.java:150)
at org.sonatype.nexus.quartz.internal.task.QuartzTaskJobListener.jobWasExecuted(QuartzTaskJobListener.java:172)
at org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1967)
… 11 common frames omitted

I’ve already increased the memory of the server and, additionally, restore the server previous snapshot done for the upgrade. It must be said that this log appears when I’ve already upgraded the server and I try to start the nexus service.

Could you indicate some way to figure out this issue? Do you know how to fix it?

STOPPED indicates some part of startup probably failed, or you have some custom plugin or scripting that is stopping it after it started.

If you don’t see anything, I would suggest trying a fresh download and extract of Nexus. (Obviously should back up your database and blobs, not overwrite them)

In the beginning of log you can see: Failed to run task ‘Rebuilding search index of *’;
Any ideas on how to workaround it?

You can try shutting down nxrm (if it is running) and renaming $datadir/elasticsearch to $datadir/elasticsearch.old. Then start up, go to “system → tasks” and schedule a repair rebuild repository search task to run against all repositories.