Upgrade from 2.15.1-02 to 3.38.1-01 fails with OutOfMemoryError

I am trying to upgrade from Nexus 2 OSS to Nexus 3 OSS . The v2 instance is running v2.15.1-02 on-premises on a Windows 2008 server. The v3 instance is running v3.38.1-01 in AWS as a Docker container using an S3 blob store. In the v3 UI, the migration processes 335k entries, then fails with a “read timed out” error. Looking in the v2 logs, I can see that it has run out of Java heap space.

Log messages in upgrade UI in v3:

2022-Apr-06 09:40:04 Initialized
2022-Apr-06 09:40:28 Running
2022-Apr-06 16:52:53 HTTP disconnection: Read timed out, retrying at Wed Apr 06 06:52:58 UTC 2022
2022-Apr-06 16:52:58 HTTP connection restored
2022-Apr-07 08:46:41 HTTP disconnection: Read timed out, retrying at Wed Apr 06 22:46:46 UTC 2022
2022-Apr-07 08:47:06 HTTP disconnection: Read timed out, retrying at Wed Apr 06 22:47:11 UTC 2022
2022-Apr-07 08:47:12 HTTP connection restored
2022-Apr-07 10:31:20 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:31:25 UTC 2022
2022-Apr-07 10:31:45 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:31:50 UTC 2022
2022-Apr-07 10:32:10 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:32:20 UTC 2022
2022-Apr-07 10:32:40 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:32:55 UTC 2022
2022-Apr-07 10:33:15 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:33:40 UTC 2022
2022-Apr-07 10:34:00 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:34:40 UTC 2022
2022-Apr-07 10:35:00 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:36:05 UTC 2022
2022-Apr-07 10:36:25 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:38:10 UTC 2022
2022-Apr-07 10:38:30 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:41:20 UTC 2022
2022-Apr-07 10:41:41 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:46:16 UTC 2022
2022-Apr-07 10:46:36 HTTP disconnection: Read timed out, retrying at Thu Apr 07 00:54:01 UTC 2022
2022-Apr-07 10:54:21 HTTP disconnection: Read timed out, retrying at Thu Apr 07 01:06:21 UTC 2022

Excerpt from nexus.log on v2 instance:

2022-04-07 10:29:11,347+1000 DEBUG [qtp992512737-4137] *UNKNOWN com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource - migration changelog contains 335803 total entries
2022-04-07 10:30:09,005+1000 DEBUG [qtp992512737-4070] *UNKNOWN com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource - migration changelog contains 335803 total entries
2022-04-07 10:32:15,927+1000 DEBUG [qtp992512737-3983] *UNKNOWN com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource - migration changelog contains 335803 total entries
2022-04-07 10:32:18,579+1000 ERROR [qtp992512737-3983]  org.sonatype.nexus.web.internal.ErrorPageFilter - Internal error: null
2022-04-07 10:44:44,836+1000 WARN  [qtp992512737-4200]  org.eclipse.jetty.io.ManagedSelector - java.lang.OutOfMemoryError: GC overhead limit exceeded
2022-04-07 10:44:56,785+1000 WARN  [qtp992512737-4099] *UNKNOWN org.sonatype.sisu.siesta.server.internal.mappers.ThrowableExceptionMapper - com.orientechnologies.orient.core.exception.ODatabaseException: Error on retrieving record #3:6205 (cluster: default)
com.orientechnologies.orient.core.exception.ODatabaseException: Error on retrieving record #3:6205 (cluster: default)
	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeReadRecord(ODatabaseDocumentTx.java:1885)
	at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:243)
	at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:217)
	at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:347)
	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:1594)
	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:122)
	at com.orientechnologies.orient.core.record.impl.ODocument.field(ODocument.java:797)
	at com.bolyuba.nexus.plugin.npm.service.internal.orient.PackageRootHandler.toEntity(PackageRootHandler.java:93)
	at com.bolyuba.nexus.plugin.npm.service.internal.orient.PackageRootHandler.toEntity(PackageRootHandler.java:35)
	at com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore.getPackageByName(OrientMetadataStore.java:286)
	at com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore.getPackageByName(OrientMetadataStore.java:266)
	at com.sonatype.nexus.migrationagent.repository.migrators.NpmRepositoryMigrator.extract(NpmRepositoryMigrator.java:58)
	at com.sonatype.nexus.migrationagent.repository.RepositoryMigratorSupport.extract(RepositoryMigratorSupport.java:266)
	at com.sonatype.nexus.migrationagent.repository.RepositoryMigrator$extract$0.call(Unknown Source)
	at com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource$_get_closure1$_closure2.doCall(RepositoryChangelogResource.groovy:117)
	at sun.reflect.GeneratedMethodAccessor213.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
	at groovy.lang.Closure.call(Closure.java:420)
	at groovy.lang.Closure.call(Closure.java:436)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2125)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2110)
	at org.codehaus.groovy.runtime.dgm$159.invoke(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
	at com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource$_get_closure1.doCall(RepositoryChangelogResource.groovy:108)
	at sun.reflect.GeneratedMethodAccessor239.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
	at groovy.lang.Closure.call(Closure.java:420)
	at groovy.lang.Closure.call(Closure.java:436)
	at org.codehaus.groovy.runtime.IOGroovyMethods.withCloseable(IOGroovyMethods.java:1630)
	at org.codehaus.groovy.runtime.NioGroovyMethods.withCloseable(NioGroovyMethods.java:1759)
	at sun.reflect.GeneratedMethodAccessor231.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:54)
	at org.codehaus.groovy.runtime.metaclass.NewInstanceMetaMethod.invoke(NewInstanceMetaMethod.java:56)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
	at com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource.get(RepositoryChangelogResource.groovy:107)
	at com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource.getAsSmile(RepositoryChangelogResource.groovy:151)
	at sun.reflect.GeneratedMethodAccessor238.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
	at org.sonatype.sisu.siesta.server.internal.SiestaServlet.service(SiestaServlet.java:121)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:297)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:281)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:186)
	at com.google.inject.servlet.AbstractServletPipeline.service(AbstractServletPipeline.java:65)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.inject.servlet.AbstractFilterPipeline.dispatch(AbstractFilterPipeline.java:100)
	at org.sonatype.nexus.web.internal.NexusGuiceFilter$MultiFilterChain.doFilter(NexusGuiceFilter.java:82)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:89)
	at com.sonatype.nexus.analytics.internal.RestRequestCollector.doFilter(RestRequestCollector.java:81)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:450)
	at org.sonatype.nexus.web.internal.SecurityFilter.executeChain(SecurityFilter.java:90)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.inject.servlet.AbstractFilterPipeline.dispatch(AbstractFilterPipeline.java:100)
	at org.sonatype.nexus.web.internal.NexusGuiceFilter$MultiFilterChain.doFilter(NexusGuiceFilter.java:82)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:89)
	at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at org.sonatype.nexus.web.internal.CommonHeadersFilter.doFilter(CommonHeadersFilter.java:69)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at org.sonatype.nexus.web.internal.ErrorPageFilter.doFilter(ErrorPageFilter.java:71)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at org.sonatype.nexus.web.internal.BaseUrlHolderFilter.doFilter(BaseUrlHolderFilter.java:66)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at org.sonatype.nexus.web.internal.HeaderPatternFilter.doFilter(HeaderPatternFilter.java:96)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.inject.servlet.AbstractFilterPipeline.dispatch(AbstractFilterPipeline.java:100)
	at org.sonatype.nexus.web.internal.NexusGuiceFilter$MultiFilterChain.doFilter(NexusGuiceFilter.java:82)
	at org.sonatype.nexus.web.internal.NexusGuiceFilter$MultiFilterPipeline.dispatch(NexusGuiceFilter.java:56)
	at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133)
	at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130)
	at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:175)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: Java heap space
	at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.readFullEntry(OPaginatedCluster.java:1434)
	at com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster.readRecord(OPaginatedCluster.java:562)
	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doReadRecord(OAbstractPaginatedStorage.java:2150)
	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.readRecord(OAbstractPaginatedStorage.java:1877)
	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.readRecord(OAbstractPaginatedStorage.java:840)
	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$SimpleRecordReader.readRecord(ODatabaseDocumentTx.java:3175)
	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeReadRecord(ODatabaseDocumentTx.java:1850)
	at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:243)
	at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:217)
	at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:347)
	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:1594)
	at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:122)
	at com.orientechnologies.orient.core.record.impl.ODocument.field(ODocument.java:797)
	at com.bolyuba.nexus.plugin.npm.service.internal.orient.PackageRootHandler.toEntity(PackageRootHandler.java:93)
	at com.bolyuba.nexus.plugin.npm.service.internal.orient.PackageRootHandler.toEntity(PackageRootHandler.java:35)
	at com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore.getPackageByName(OrientMetadataStore.java:286)
	at com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore.getPackageByName(OrientMetadataStore.java:266)
	at com.sonatype.nexus.migrationagent.repository.migrators.NpmRepositoryMigrator.extract(NpmRepositoryMigrator.java:58)
	at com.sonatype.nexus.migrationagent.repository.RepositoryMigratorSupport.extract(RepositoryMigratorSupport.java:266)
	at com.sonatype.nexus.migrationagent.repository.RepositoryMigrator$extract$0.call(Unknown Source)
	at com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource$_get_closure1$_closure2.doCall(RepositoryChangelogResource.groovy:117)
	at sun.reflect.GeneratedMethodAccessor213.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
	at groovy.lang.Closure.call(Closure.java:420)
	at groovy.lang.Closure.call(Closure.java:436)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2125)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2110)

I have tried the upgrade 3 separate times, each with different max heap sizes on the v2 instance. First it was the default 768M, then 4G then 12G. The upgrade runs for about 26 hours, then hits the same OutOfMemoryError each time.

Looking at the heap dump, I see ~300 com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource$ChangeEntryXO objects, which collectively occupy ~10GB. I’m not sure what these objects mean, but they seem to be related to our npmjs proxy repository somehow.

What can I do to fix this? Is this a known issue?

The migration wizard at the very beginning has a way for you to specify the changelog size. Default is 100 - try setting it to 20.

The heap issue is caused by package.json for NPM package metadata being very large for some packages.

1 Like

Thanks for the tip! I tried 10 and the migration worked this time. It didn’t seem to take any longer either.