NumberFormatException when fetching index for Maven Central


#1

My local Nexus OSS 2.14.11-01 instance has started throwing NumberFormatExceptions when it tries to fetch the Maven Central index:

java.io.IOException: Exception(s) happened during reindexAllRepositories()
	at org.sonatype.nexus.index.DefaultIndexerManager.reindexAllRepositories(DefaultIndexerManager.java:930)
	at org.sonatype.nexus.index.tasks.ReindexTaskHandlerLegacy.reindexAllRepositories(ReindexTaskHandlerLegacy.java:48)
	at org.sonatype.nexus.index.tasks.AbstractIndexerTask.doRun(AbstractIndexerTask.java:71)
	at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.java:163)
	at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.java:418)
	at org.sonatype.nexus.threads.MDCAwareCallable.call(MDCAwareCallable.java:44)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
	Suppressed: java.io.IOException: Cannot fetch remote index for repository "Central" [id=central], error occurred.
		at org.sonatype.nexus.index.DefaultIndexerManager.updateRemoteIndex(DefaultIndexerManager.java:1344)
		at org.sonatype.nexus.index.DefaultIndexerManager.access$1100(DefaultIndexerManager.java:188)
		at org.sonatype.nexus.index.DefaultIndexerManager$IndexUpdateRunnable.run(DefaultIndexerManager.java:1060)
		at org.sonatype.nexus.index.DefaultIndexerManager.sharedSingle(DefaultIndexerManager.java:2320)
		at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:1001)
		at org.sonatype.nexus.index.DefaultIndexerManager.reindexAllRepositories(DefaultIndexerManager.java:908)
		... 13 common frames omitted
	Caused by: java.lang.NumberFormatException: For input string: "1602="
		at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
		at java.lang.Long.parseLong(Long.java:589)
		at java.lang.Long.parseLong(Long.java:631)
		at org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator.updateArtifactInfo(MinimalArtifactInfoIndexCreator.java:357)
		at org.apache.maven.index.context.IndexUtils.constructArtifactInfo(IndexUtils.java:122)
		at org.apache.maven.index.context.DefaultIndexingContext.rebuildGroups(DefaultIndexingContext.java:716)
		at org.apache.maven.index.context.DefaultIndexingContext.merge(DefaultIndexingContext.java:643)
		at org.apache.maven.index.context.DefaultIndexingContext.merge(DefaultIndexingContext.java:583)
		at org.apache.maven.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:220)
		at org.apache.maven.index.updater.DefaultIndexUpdater.access$300(DefaultIndexUpdater.java:76)
		at org.apache.maven.index.updater.DefaultIndexUpdater$LuceneIndexAdaptor.addIndexChunk(DefaultIndexUpdater.java:642)
		at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:837)
		at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:159)
		at org.sonatype.nexus.index.DefaultIndexerManager.updateRemoteIndex(DefaultIndexerManager.java:1291)
		... 18 common frames omitted

This started on January 3rd. Could this be due to the deployment of a bad artifact?


#2

I can’t reproduce this locally. It seems like your local index may be corrupt. You can try running a “repair indexes” task against the repository to fix this. If that doesn’t work, shut down Nexus, remove “sonatype-work/nexus/indexds/central-ctx/”, and then restart and try the reindex again.


#3

Thanks for the quick response! I tried both of those solutions, but I’m still getting the same exception when running the index update task. Any other ideas?