Update from v3.70.1 to 3.71.0

I updated Nexus from v3.70.1 to 3.71.0 (Docker version) and had to migrate legacy OrientDB to H2 because I use OSS version without licence. After successful DB migration to H2, I receive Error 500 in deployment process:

2024-08-14 08:05:52,316+0000 WARN [qtp762921896-104] jenkins org.sonatype.nexus.transaction.RetryController - Exceeded retry limit: 8/8 (org.sonatype.nexus.datastore.api.DuplicateKeyException: Duplicate key)
2024-08-14 08:05:52,376+0000 WARN [qtp762921896-104] jenkins org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: PUT /repository/releases/de/test/app-service-complete/1.0.2/app-service-complete-1.0.2.zip
org.sonatype.nexus.datastore.api.DuplicateKeyException: Duplicate key
at org.sonatype.nexus.datastore.mybatis.EntityExecutor.mapException(EntityExecutor.java:255)
at org.sonatype.nexus.datastore.mybatis.EntityExecutor.update(EntityExecutor.java:77)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
at org.sonatype.nexus.datastore.mybatis.DataAccessSqlSession.update(DataAccessSqlSession.java:83)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
at com.sun.proxy.$Proxy190.createComponent(Unknown Source)
at org.sonatype.nexus.repository.content.store.ComponentStore.createComponent(ComponentStore.java:287)
at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:49)
at org.sonatype.nexus.repository.content.fluent.internal.FluentComponentBuilderImpl.createComponent(FluentComponentBuilderImpl.java:131)
at java.util.Optional.orElseGet(Optional.java:267)
at org.sonatype.nexus.repository.content.store.ContentStoreSupport.getOrCreate(ContentStoreSupport.java:97)
at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:58)
at org.sonatype.nexus.transaction.TransactionInterceptor.proceedWithTransaction(TransactionInterceptor.java:66)
at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
at org.sonatype.nexus.repository.content.fluent.internal.FluentComponentBuilderImpl.getOrCreate(FluentComponentBuilderImpl.java:106)
at org.sonatype.nexus.content.maven.internal.recipe.MavenContentFacetImpl.createOrGetComponent(MavenContentFacetImpl.java:276)
at org.sonatype.nexus.content.maven.internal.recipe.MavenContentFacetImpl.save(MavenContentFacetImpl.java:259)
at org.sonatype.nexus.content.maven.internal.recipe.MavenContentFacetImpl.put(MavenContentFacetImpl.java:231)
at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:287)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
at org.sonatype.nexus.content.maven.internal.recipe.MavenContentHandler.doPut(MavenContentHandler.java:93)
at org.sonatype.nexus.content.maven.internal.recipe.MavenContentHandler.handle(MavenContentHandler.java:64)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.content.handlers.LastDownloadedHandler.handle(LastDownloadedHandler.java:58)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.view.handlers.ContentHeadersHandler.handle(ContentHeadersHandler.java:46)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.maven.internal.VersionPolicyHandler.handle(VersionPolicyHandler.java:65)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.http.PartialFetchHandler.handle(PartialFetchHandler.java:59)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.view.handlers.ConditionalRequestHandler.handle(ConditionalRequestHandler.java:67)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at com.sonatype.nexus.clm.internal.datastore.FirewallContributedHandler.handle(FirewallContributedHandler.java:112)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at com.sonatype.analytics.internal.handler.AnalyticsBytesTransferredHandler.handle(AnalyticsBytesTransferredHandler.java:51)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at com.sonatype.analytics.internal.handler.AnalyticsBytesTransferredHandler.handle(AnalyticsBytesTransferredHandler.java:51)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.view.handlers.HandlerContributor.handle(HandlerContributor.java:67)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.view.handlers.ExceptionHandler.handle(ExceptionHandler.java:42)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.routing.internal.RoutingRuleHandler.handle(RoutingRuleHandler.java:68)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at com.sonatype.analytics.internal.LoginsCounterHandler.handle(LoginsCounterHandler.java:87)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.security.SecurityHandler.handle(SecurityHandler.java:64)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.maven.ContentDispositionHandler.handle(ContentDispositionHandler.java:42)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at com.sonatype.analytics.internal.handler.AnalyticsMeteringHandler.handle(AnalyticsMeteringHandler.java:69)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.view.handlers.TimingHandler.handle(TimingHandler.java:58)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.view.Context.start(Context.java:179)
at org.sonatype.nexus.repository.view.Router.dispatch(Router.java:65)
at org.sonatype.nexus.repository.view.ConfigurableViewFacet.dispatch(ConfigurableViewFacet.java:52)
at org.sonatype.nexus.repository.view.ConfigurableViewFacet.dispatch(ConfigurableViewFacet.java:43)
at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.dispatchAndSend(ViewServlet.java:212)
at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.doService(ViewServlet.java:174)
at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.service(ViewServlet.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:293)
at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:283)
at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:184)
at com.google.inject.servlet.DynamicServletPipeline.service(DynamicServletPipeline.java:71)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
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:154)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
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:154)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
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:154)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
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:154)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:458)
at org.sonatype.nexus.security.SecurityFilter.executeChain(SecurityFilter.java:96)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:373)
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:370)
at org.sonatype.nexus.security.SecurityFilter.doFilterInternal(SecurityFilter.java:112)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:112)
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:154)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
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:154)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
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:154)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
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:154)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:458)
at org.sonatype.nexus.security.SecurityFilter.executeChain(SecurityFilter.java:96)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:373)
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:370)
at org.sonatype.nexus.security.SecurityFilter.doFilterInternal(SecurityFilter.java:112)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at org.sonatype.nexus.repository.httpbridge.internal.ExhaustRequestFilter.doFilter(ExhaustRequestFilter.java:80)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
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:154)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
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:154)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at com.sonatype.nexus.licensing.internal.LicensingRedirectFilter.doFilter(LicensingRedirectFilter.java:116)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:112)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at org.sonatype.nexus.internal.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:79)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at org.sonatype.nexus.internal.web.EnvironmentFilter.doFilter(EnvironmentFilter.java:101)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at org.sonatype.nexus.internal.web.HeaderPatternFilter.doFilter(HeaderPatternFilter.java:98)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
at com.google.inject.servlet.DynamicFilterPipeline.dispatch(DynamicFilterPipeline.java:104)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
at org.sonatype.nexus.bootstrap.osgi.DelegatingFilter.doFilter(DelegatingFilter.java:73)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552)
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:505)
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:239)
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:750)
Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: “PRIMARY KEY ON PUBLIC.MAVEN2_COMPONENT(COMPONENT_ID) ( /* key:0 */ 36, 6, ‘de.webgui-service’, ‘webgui-service-descriptor’, ‘jar’, ‘1.0.0-20240305.105155-1’, JSON '{”“maven2"”:{““baseVersion””:““1.0.0-SNAPSHOT””,““groupId””:““de.webgui-service””,““artifactId””:““webgui-service-descriptor””,““packaging””:““jar””,““version””:““1.0.0-20240305.105155-1"”}}', TIMESTAMP WITH TIME ZONE ‘2024-03-05 10:51:57.944+00’, TIMESTAMP WITH TIME ZONE ‘2024-08-14 07:56:33.862186+00’, ‘1.0.0-SNAPSHOT’, ‘000000001.000000000.000000000.b.020240305.000105155-000000001’, NULL)”; SQL statement:
INSERT INTO maven2_component (repository_id, namespace, name, kind, version, normalized_version, attributes

) VALUES (?, ?, ?,
?, ?, ?, ?
 
) [23505-224]

I checked the database, there is no duplication and the related repository is allowed for redeploy. This problem is just happens on v3.71.0. Is there any bug? Hope to fix on v3.72 ?

1 Like

I got a similar Error after migrating the orientDB to H2. I did a docker pull on my proxy repository and if the image is not already present, Nexus throws a DuplicateKeyException. I went over the documentation several times and could not find anything im doing wrong.

1 Like

Hi @ all,
I got the same error when pushing files to Nexus repository.
I hope it’s a bug which will be fixed soon.

1 Like

After lots of search I found the solution. These queries should run on H2 database to get rid of sequence conflict:

ALTER TABLE TAG ALTER COLUMN ID RESTART WITH SELECT MAX(ID) + 1 FROM TAG;
ALTER TABLE RAW_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM RAW_CONTENT_REPOSITORY;
ALTER TABLE RAW_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM RAW_COMPONENT;
ALTER TABLE RAW_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM RAW_COMPONENT_TAG;
ALTER TABLE RAW_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM RAW_ASSET_BLOB;
ALTER TABLE APT_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM APT_BROWSE_NODE;
ALTER TABLE MAVEN2_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM MAVEN2_CONTENT_REPOSITORY;
ALTER TABLE UPGRADE_TASKS ALTER COLUMN ID RESTART WITH SELECT MAX(ID) + 1 FROM UPGRADE_TASKS;
ALTER TABLE SOFT_DELETED_BLOBS ALTER COLUMN RECORD_ID RESTART WITH SELECT MAX(RECORD_ID) + 1 FROM SOFT_DELETED_BLOBS;
ALTER TABLE MAVEN2_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM MAVEN2_COMPONENT_TAG;
ALTER TABLE MAVEN2_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM MAVEN2_ASSET_BLOB;
ALTER TABLE NUGET_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM NUGET_CONTENT_REPOSITORY;
ALTER TABLE NPM_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM NPM_BROWSE_NODE;
ALTER TABLE NUGET_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM NUGET_ASSET;
ALTER TABLE NUGET_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM NUGET_COMPONENT_TAG;
ALTER TABLE NUGET_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM NUGET_ASSET_BLOB;
ALTER TABLE HELM_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM HELM_CONTENT_REPOSITORY;
ALTER TABLE HELM_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM HELM_COMPONENT;
ALTER TABLE HELM_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM HELM_COMPONENT_TAG;
ALTER TABLE HELM_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM HELM_ASSET_BLOB;
ALTER TABLE YUM_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM YUM_BROWSE_NODE;
ALTER TABLE DOCKER_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM DOCKER_CONTENT_REPOSITORY;
ALTER TABLE DOCKER_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM DOCKER_COMPONENT;
ALTER TABLE DOCKER_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM DOCKER_COMPONENT_TAG;
ALTER TABLE DOCKER_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM DOCKER_ASSET_BLOB;
ALTER TABLE RUBYGEMS_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM RUBYGEMS_BROWSE_NODE;
ALTER TABLE PYPI_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM PYPI_CONTENT_REPOSITORY;
ALTER TABLE PYPI_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM PYPI_COMPONENT;
ALTER TABLE PYPI_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM PYPI_COMPONENT_TAG;
ALTER TABLE PYPI_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM PYPI_ASSET_BLOB;
ALTER TABLE GITLFS_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM GITLFS_BROWSE_NODE;
ALTER TABLE YUM_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM YUM_CONTENT_REPOSITORY;
ALTER TABLE YUM_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM YUM_COMPONENT;
ALTER TABLE YUM_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM YUM_COMPONENT_TAG;
ALTER TABLE YUM_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM YUM_ASSET_BLOB;
ALTER TABLE DOCKER_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM DOCKER_BROWSE_NODE;
ALTER TABLE NPM_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM NPM_CONTENT_REPOSITORY;
ALTER TABLE NPM_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM NPM_COMPONENT;
ALTER TABLE NPM_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM NPM_COMPONENT_TAG;
ALTER TABLE NPM_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM NPM_ASSET_BLOB;
ALTER TABLE RAW_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM RAW_BROWSE_NODE;
ALTER TABLE APT_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM APT_CONTENT_REPOSITORY;
ALTER TABLE APT_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM APT_COMPONENT;
ALTER TABLE APT_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM APT_COMPONENT_TAG;
ALTER TABLE APT_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM APT_ASSET_BLOB;
ALTER TABLE MAVEN2_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM MAVEN2_BROWSE_NODE;
ALTER TABLE CONDA_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM CONDA_CONTENT_REPOSITORY;
ALTER TABLE CONDA_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM CONDA_COMPONENT;
ALTER TABLE CONDA_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM CONDA_COMPONENT_TAG;
ALTER TABLE CONDA_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM CONDA_ASSET_BLOB;
ALTER TABLE PYPI_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM PYPI_BROWSE_NODE;
ALTER TABLE CONAN_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM CONAN_CONTENT_REPOSITORY;
ALTER TABLE CONAN_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM CONAN_COMPONENT;
ALTER TABLE CONAN_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM CONAN_COMPONENT_TAG;
ALTER TABLE CONAN_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM CONAN_ASSET_BLOB;
ALTER TABLE CONDA_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM CONDA_BROWSE_NODE;
ALTER TABLE R_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM R_CONTENT_REPOSITORY;
ALTER TABLE R_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM R_COMPONENT;
ALTER TABLE R_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM R_COMPONENT_TAG;
ALTER TABLE R_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM R_ASSET_BLOB;
ALTER TABLE CONAN_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM CONAN_BROWSE_NODE;
ALTER TABLE GITLFS_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM GITLFS_CONTENT_REPOSITORY;
ALTER TABLE GITLFS_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM GITLFS_COMPONENT;
ALTER TABLE GITLFS_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM GITLFS_COMPONENT_TAG;
ALTER TABLE GITLFS_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM GITLFS_ASSET_BLOB;
ALTER TABLE HELM_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM HELM_BROWSE_NODE;
ALTER TABLE COCOAPODS_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM COCOAPODS_CONTENT_REPOSITORY;
ALTER TABLE COCOAPODS_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM COCOAPODS_COMPONENT;
ALTER TABLE COCOAPODS_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM COCOAPODS_COMPONENT_TAG;
ALTER TABLE COCOAPODS_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM COCOAPODS_ASSET_BLOB;
ALTER TABLE R_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM R_BROWSE_NODE;
ALTER TABLE RUBYGEMS_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM RUBYGEMS_CONTENT_REPOSITORY;
ALTER TABLE RUBYGEMS_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM RUBYGEMS_COMPONENT;
ALTER TABLE RUBYGEMS_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM RUBYGEMS_COMPONENT_TAG;
ALTER TABLE RUBYGEMS_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM RUBYGEMS_ASSET_BLOB;
ALTER TABLE NUGET_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM NUGET_BROWSE_NODE;
ALTER TABLE GO_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM GO_CONTENT_REPOSITORY;
ALTER TABLE GO_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM GO_COMPONENT;
ALTER TABLE GO_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM GO_COMPONENT_TAG;
ALTER TABLE GO_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM GO_ASSET_BLOB;
ALTER TABLE COCOAPODS_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM COCOAPODS_BROWSE_NODE;
ALTER TABLE P2_CONTENT_REPOSITORY ALTER COLUMN REPOSITORY_ID RESTART WITH SELECT MAX(REPOSITORY_ID) + 1 FROM P2_CONTENT_REPOSITORY;
ALTER TABLE P2_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM P2_COMPONENT;
ALTER TABLE P2_COMPONENT_TAG ALTER COLUMN COMPONENT_TAG_ID RESTART WITH SELECT MAX(COMPONENT_TAG_ID) + 1 FROM P2_COMPONENT_TAG;
ALTER TABLE P2_ASSET_BLOB ALTER COLUMN ASSET_BLOB_ID RESTART WITH SELECT MAX(ASSET_BLOB_ID) + 1 FROM P2_ASSET_BLOB;
ALTER TABLE GO_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM GO_BROWSE_NODE;
ALTER TABLE MAVEN2_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM MAVEN2_COMPONENT;
ALTER TABLE LOGGING_OVERRIDES ALTER COLUMN ID RESTART WITH SELECT MAX(ID) + 1 FROM LOGGING_OVERRIDES;
ALTER TABLE BLOB_STORE_METRICS ALTER COLUMN ID RESTART WITH SELECT MAX(ID) + 1 FROM BLOB_STORE_METRICS;
ALTER TABLE MAVEN2_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM MAVEN2_ASSET;
ALTER TABLE APT_KEY_VALUE ALTER COLUMN KEY_VALUE_ID RESTART WITH SELECT MAX(KEY_VALUE_ID) + 1 FROM APT_KEY_VALUE;
ALTER TABLE APT_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM APT_ASSET;
ALTER TABLE RAW_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM RAW_ASSET;
ALTER TABLE AGGREGATED_METRICS ALTER COLUMN AGGREGATED_METRIC_ID RESTART WITH SELECT MAX(AGGREGATED_METRIC_ID) + 1 FROM AGGREGATED_METRICS;
ALTER TABLE HISTORICAL_LOGIN_INFO ALTER COLUMN HISTORICAL_LOGIN_INFO_ID RESTART WITH SELECT MAX(HISTORICAL_LOGIN_INFO_ID) + 1 FROM HISTORICAL_LOGIN_INFO;
ALTER TABLE METRICS_LOG ALTER COLUMN METRIC_ID RESTART WITH SELECT MAX(METRIC_ID) + 1 FROM METRICS_LOG;
ALTER TABLE NPM_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM NPM_ASSET;
ALTER TABLE NUGET_COMPONENT ALTER COLUMN COMPONENT_ID RESTART WITH SELECT MAX(COMPONENT_ID) + 1 FROM NUGET_COMPONENT;
ALTER TABLE RUBYGEMS_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM RUBYGEMS_ASSET;
ALTER TABLE DOWNLOAD_COUNT ALTER COLUMN DOWNLOAD_COUNT_ID RESTART WITH SELECT MAX(DOWNLOAD_COUNT_ID) + 1 FROM DOWNLOAD_COUNT;
ALTER TABLE DOCKER_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM DOCKER_ASSET;
ALTER TABLE YUM_KEY_VALUE ALTER COLUMN KEY_VALUE_ID RESTART WITH SELECT MAX(KEY_VALUE_ID) + 1 FROM YUM_KEY_VALUE;
ALTER TABLE YUM_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM YUM_ASSET;
ALTER TABLE COMPONENT_APPLICATION_SCAN_SCHEDULE ALTER COLUMN ID RESTART WITH SELECT MAX(ID) + 1 FROM COMPONENT_APPLICATION_SCAN_SCHEDULE;
ALTER TABLE COMPONENT_APPLICATION_SCAN ALTER COLUMN ID RESTART WITH SELECT MAX(ID) + 1 FROM COMPONENT_APPLICATION_SCAN;
ALTER TABLE HELM_KEY_VALUE ALTER COLUMN KEY_VALUE_ID RESTART WITH SELECT MAX(KEY_VALUE_ID) + 1 FROM HELM_KEY_VALUE;
ALTER TABLE HELM_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM HELM_ASSET;
ALTER TABLE GITLFS_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM GITLFS_ASSET;
ALTER TABLE PYPI_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM PYPI_ASSET;
ALTER TABLE CONDA_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM CONDA_ASSET;
ALTER TABLE CONAN_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM CONAN_ASSET;
ALTER TABLE R_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM R_ASSET;
ALTER TABLE COCOAPODS_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM COCOAPODS_ASSET;
ALTER TABLE GO_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM GO_ASSET;
ALTER TABLE P2_ASSET ALTER COLUMN ASSET_ID RESTART WITH SELECT MAX(ASSET_ID) + 1 FROM P2_ASSET;
ALTER TABLE P2_BROWSE_NODE ALTER COLUMN NODE_ID RESTART WITH SELECT MAX(NODE_ID) + 1 FROM P2_BROWSE_NODE;

But is this something official? I just found an unofficial bash script editing the database in a similar way. But imo this is more of a workaround than a solution.

1 Like

It’s not an official solution but solved my problem. It’s based on that script from github :wink:

1 Like

Thanks for these reports, I’ve created an issue in our internal tracker for this (NEXUS-43935). I will be recommending that our engineering investigate.

4 Likes

see Cannot upload after OrientDB to H2 migration: Unique index or primary key violation · Issue #449 · sonatype/nexus-public · GitHub

1 Like

Is the approximate release date of the new version of the H2 migration tool known perhaps? (rev 4) I had exactly the same problem, however, I restored the backup with version 3.70.1. I would not like to change the records in the database myself, the preferred method would be to use the official solution.

4 Likes

Hi all,
Sorry for the friction you’ve experienced. We’ve investigated NEXUS-43935 and are planning for a point release very soon. We will keep you posted.

4 Likes

As I can see fix has been released yesterday:

https://help.sonatype.com/en/orientdb-downloads.html

1 Like