sonatype-nexus-community / nexus-repository-composer

Composer support for the Nexus Repository Manager (work in progress!)
Eclipse Public License 1.0
216 stars 84 forks source link

Hosted composer packages that were published before update are not available via v2 api #116

Closed func0der closed 2 years ago

func0der commented 2 years ago

What are you trying to do?

Having:

Then:

What feature or behavior is this required for?

Downloading packages via composer v2 api

How could we solve this issue? (Not knowing is okay!)

It seems that Nexus is only creating the package metadata when the packages are published. Even though that seems to be the case, I have inconsistent behavior between a hosted instance and the docker container I can create with this repo. In the docker container republishing the same version of a package seems to trigger the creation of v2 metadata. In the hosted instance it does not.

In both versions I can delete a version package and publish it again afterwards and the v2 metadata is created. This is not a suitable workaround though.

I would recon, that re-indexing the packages should trigger the creation of the v2 metadata, BUT:

  1. I am not sure about that

  2. It does not seem to work, because of this:

     2022-06-24 11:06:42,804+0200 ERROR [quartz-12-thread-15]  *SYSTEM org.sonatype.nexus.repository.content.search.SearchFacetImpl - Unable to rebuild search index for repository composer-internal org.sonatype.nexus.repository.MissingFacetException: No facet of type ContentFacet attached to repository composer-internal
     at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.facet(RepositoryImpl.java:322)
     at org.sonatype.nexus.repository.content.search.SearchFacetImpl.rebuildComponentIndex(SearchFacetImpl.java:154)
     at org.sonatype.nexus.repository.content.search.SearchFacetImpl.rebuildIndex(SearchFacetImpl.java:145)
     at org.sonatype.nexus.repository.content.search.SearchFacetImpl$$EnhancerByGuice$$421846345.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.SearchFacetImpl$$EnhancerByGuice$$421846345.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:748)

Anything else?

Nope