# Task 'Rebuilding Maven Metadata' execution failure

**URL:** <https://community.sonatype.com/t/task-rebuilding-maven-metadata-execution-failure/8845>\
**Category:** Sonatype Nexus Repository\
**Tags:** scheduled-task\
**Created:** [June 20, 2022, 12:51pm UTC](https://community.sonatype.com/t/task-rebuilding-maven-metadata-execution-failure/8845 "2022-06-20T12:51:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alberto.benini](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@alberto.benini](https://community.sonatype.com/u/alberto.benini)\
**Post date:** [June 20, 2022, 12:51pm UTC](https://community.sonatype.com/t/task-rebuilding-maven-metadata-execution-failure/8845/1 "2022-06-20T12:51:05Z")

</div>

We use Nexus OSS 3.39.0-01

I have defined a a Task scheduled daily for Rebuild Maven repository metadata.

Bu we got the following task execution failure:

Task Name: Rebuild Maven repository metadata (maven-metadata.xml) - daily  
Stack-trace:  
org.sonatype.goodies.common.MultipleFailures$MultipleFailuresException: Failed to run task ‘Rebuilding Maven Metadata of \*’; 1 failure  
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: java.lang.NullPointerException  
at org.sonatype.nexus.repository.maven.internal.hosted.metadata.MetadataBuilder.onExitBaseVersion(MetadataBuilder.java:256)  
at org.sonatype.nexus.repository.maven.internal.orient.OrientMetadataRebuilder$OrientWorker.rebuildBaseVersion(OrientMetadataRebuilder.java:407)  
at org.sonatype.nexus.repository.maven.internal.orient.OrientMetadataRebuilder$OrientWorker.lambda$4(OrientMetadataRebuilder.java:319)  
at org.sonatype.nexus.transaction.OperationPoint.lambda$0(OperationPoint.java:53)  
at org.sonatype.nexus.transaction.OperationPoint.proceed(OperationPoint.java:64)  
at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:58)  
at org.sonatype.nexus.transaction.Operations.proceedWithTransaction(Operations.java:232)  
at org.sonatype.nexus.transaction.Operations.transactional(Operations.java:219)  
at org.sonatype.nexus.transaction.Operations.run(Operations.java:175)  
at org.sonatype.nexus.repository.maven.internal.orient.OrientMetadataRebuilder$OrientWorker.rebuildMetadataInner(OrientMetadataRebuilder.java:319)  
at org.sonatype.nexus.repository.maven.internal.hosted.metadata.AbstractMetadataRebuilder$Worker.rebuildMetadata(AbstractMetadataRebuilder.java:232)  
at org.sonatype.nexus.repository.maven.internal.orient.OrientMetadataRebuilder.rebuildInTransaction(OrientMetadataRebuilder.java:130)  
at org.sonatype.nexus.repository.maven.internal.orient.OrientMetadataRebuilder.rebuild(OrientMetadataRebuilder.java:112)  
at org.sonatype.nexus.repository.maven.internal.orient.MavenHostedFacetImpl.rebuildMetadata(MavenHostedFacetImpl.java:118)  
at org.sonatype.nexus.repository.maven.tasks.RebuildMaven2MetadataTask.execute(RebuildMaven2MetadataTask.java:60)  
at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:79)  
… 13 more

Reading this log I don’t understand what I have to analyze and how to fix the problem…

---

<div class="post-metadata">

**Author:** ![b.eckenfels](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/b.eckenfels/32/2438_2.png) [@b.eckenfels](https://community.sonatype.com/u/b.eckenfels)\
**Post date:** [September 20, 2022, 10:46pm UTC](https://community.sonatype.com/t/task-rebuilding-maven-metadata-execution-failure/8845/2 "2022-09-20T22:46:12Z")

</div>

This seems to be an big with malformed artifact versions, it’s here sitting since a few month: [[NEXUS-31231] Invalid snapshot version will cause Maven metadata rebuild process to fail with NullPointerException - Sonatype JIRA](https://issues.sonatype.org/browse/NEXUS-31231)

There are also other NPEs in this area, which is quite unfortunate since it is especially important in critical restore situations… (as I learned last weekend ,)
