Unable to rebuild search index for repository composer-hosted

Hi All,

I can no longer rebuild indexes for composer-hosted, this issue seems to have been triggered when a releases when PUT with a tagged version; such as 1.0.0-dev1. Nexus didn’t like the -dev1.

After deleting the composer package, the indexes won’t build and even though the UI doesn’t show the package, Nexus still knows about the package with -dev1.

This also means that because the indexing is broken, it causes issues for anything else I PUT into composer-hosted.

The is the log that shows the issue. Does anyone know how to fix this? I’m happy to access the database via OrientDB, but don’t know what to look for other than I can still see subsequent packages PUT into composer-hosted, but have since be all deleted.

These show in the CLASSES asset, component and browse_node. Oddly, I cannot, as yet, find any reference to the -dev1 tag release, but it’s there is I try to composer req that particular package.

Any ideas?

Many thanks in advance,
Kevin

2024-05-21 18:12:16,458+0000 ERROR [quartz-13-thread-20]  *SYSTEM org.sonatype.nexus.repository.content.search.elasticsearch.SearchFacetImpl - Unable to rebuild search index for repository composer-hosted
org.sonatype.nexus.repository.MissingFacetException: No facet of type ContentFacet attached to repository composer-hosted
	at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.facet(RepositoryImpl.java:327)
	at org.sonatype.nexus.repository.content.search.elasticsearch.SearchFacetImpl.rebuildComponentIndex(SearchFacetImpl.java:156)
	at org.sonatype.nexus.repository.content.search.elasticsearch.SearchFacetImpl.rebuildIndex(SearchFacetImpl.java:147)
	at org.sonatype.nexus.repository.content.search.elasticsearch.SearchFacetImpl$$EnhancerByGuice$$433225410.GUICE$TRAMPOLINE(<generated>)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:74)
	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 com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
	at com.google.inject.internal.InterceptorStackCallback.invoke(InterceptorStackCallback.java:55)
	at org.sonatype.nexus.repository.content.search.elasticsearch.SearchFacetImpl$$EnhancerByGuice$$433225410.rebuildIndex(<generated>)
	at org.sonatype.nexus.repository.search.index.RebuildIndexTask.execute(RebuildIndexTask.java:33)
	at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:79)
	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:750)
2024-05-21 18:12:16,459+0000 INFO  [quartz-13-thread-20]  *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'Repair - Rebuild repository search' [repository.rebuild-index] state change RUNNING -> OK
2024-05-21 18:12:16,532+0000 INFO  [elasticsearch[A8334871-A0F91A52-A1C79013-62641B34-8FE0E935][clusterService#updateTask][T#1]]  *SYSTEM org.elasticsearch.cluster.routing.allocation - [A8334871-A0F91A52-A1C79013-62641B34-8FE0E935] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[18ffb221aedff62e98e358427548207a2dbfebc7][0]] ...]).

The stack trace suggests you may be running in SQL mode. The community composer plugin hasn’t been updated for it.

Hi Matthew,

Not sure what SQL mode means exactly. The composer plugin has been installed for the last 18 months for caching packagist repos. We just started using it to publish our private repo’s to composer-hosted - this actually worked until I submitted one with a version of -dev1. When I deleted it (after Nexus complained about it) that’s when the problem occurred and received the exception error. Before that, the our ZIP packages to composer-hosted were working fine.

If SQL mode is incorrect, what mode should it be running as and how do I change that?

TIA