Nexus startup failed, version Nexus 3.70.3-01

Nexus failed to start, I found 2 error messages as follows: ERROR1, ERROR2.

ERROR1:
2024-10-27 06:51:51,468+0800 WARN [FelixStartLevel] *SYSTEM Sisu - Problem adding: org.eclipse.sisu.inject.LazyBeanEntry@250bfa46 to: org.sonatype.nexus.datastore.mybatis.MyBatisDataStore$$EnhancerByGuice$$14da4b92@205a2b1 via: org.sonatype.nexus.datastore.internal.DataStoreManagerImpl$DataAccessMediator@f3c60f8
org.sonatype.nexus.datastore.api.DataAccessException:

Error updating database. Cause: org.h2.jdbc.JdbcSQLNonTransientException: General error: “org.h2.mvstore.MVStoreException: Chunk 13011 not found [2.2.224/9]”; SQL statement:


– each format has an asset blob table which they can extend

CREATE TABLE IF NOT EXISTS maven2_asset_blob (
asset_blob_id INT GENERATED BY DEFAULT AS IDENTITY,
blob_ref VARCHAR NOT NULL,
blob_size BIGINT NOT NULL,
content_type VARCHAR NOT NULL,
checksums JSON NOT NULL,
blob_created TIMESTAMP WITH TIME ZONE NOT NULL,
created_by VARCHAR,
created_by_ip VARCHAR,

  CONSTRAINT pk_maven2_asset_blob_id PRIMARY KEY (asset_blob_id),
  CONSTRAINT uk_maven2_asset_blob_ref UNIQUE (blob_ref)
) [50000-224]

The error may exist in org.sonatype.nexus.content.maven.store.Maven2AssetBlobDAO

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: – – each format has an asset blob table which they can extend – CREATE TABLE IF NOT EXISTS maven2_asset_blob ( asset_blob_id INT GENERATED BY DEFAULT AS IDENTITY, blob_ref VARCHAR NOT NULL, blob_size BIGINT NOT NULL, content_type VARCHAR NOT NULL, checksums JSON NOT NULL, blob_created TIMESTAMP WITH TIME ZONE NOT NULL, created_by VARCHAR, created_by_ip VARCHAR, CONSTRAINT pk_maven2_asset_blob_id PRIMARY KEY (asset_blob_id), CONSTRAINT uk_maven2_asset_blob_ref UNIQUE (blob_ref) ); ALTER TABLE maven2_asset_blob ADD COLUMN IF NOT EXISTS added_to_repository TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP; CREATE INDEX IF NOT EXISTS idx_maven2_asset_blob_added_to_repository ON maven2_asset_blob (added_to_repository); CREATE INDEX IF NOT EXISTS idx_maven2_asset_blob_created ON maven2_asset_blob (blob_created); –

Cause: org.h2.jdbc.JdbcSQLNonTransientException: General error: “org.h2.mvstore.MVStoreException: Chunk 13011 not found [2.2.224/9]”; SQL statement:


– each format has an asset blob table which they can extend

CREATE TABLE IF NOT EXISTS maven2_asset_blob (
asset_blob_id INT GENERATED BY DEFAULT AS IDENTITY,
blob_ref VARCHAR NOT NULL,
blob_size BIGINT NOT NULL,
content_type VARCHAR NOT NULL,
checksums JSON NOT NULL,
blob_created TIMESTAMP WITH TIME ZONE NOT NULL,
created_by VARCHAR,
created_by_ip VARCHAR,

  CONSTRAINT pk_maven2_asset_blob_id PRIMARY KEY (asset_blob_id),
  CONSTRAINT uk_maven2_asset_blob_ref UNIQUE (blob_ref)
) [50000-224]
at org.sonatype.nexus.datastore.mybatis.DataAccessSqlSession.unwrapMyBatisException(DataAccessSqlSession.java:125)
at org.sonatype.nexus.datastore.mybatis.DataAccessSqlSession.update(DataAccessSqlSession.java:86)
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.$Proxy191.createSchema(Unknown Source)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.register(MyBatisDataStore.java:281)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.lambda$2(MyBatisDataStore.java:597)
at java.util.Arrays$ArrayList.forEach(Arrays.java:3880)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.registerTemplatedMapper(MyBatisDataStore.java:594)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.registerDataAccessMapper(MyBatisDataStore.java:548)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.register(MyBatisDataStore.java:270)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.lambda$2(MyBatisDataStore.java:597)
at java.util.Arrays$ArrayList.forEach(Arrays.java:3880)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.registerTemplatedMapper(MyBatisDataStore.java:594)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.registerDataAccessMapper(MyBatisDataStore.java:548)
at org.sonatype.nexus.datastore.mybatis.MyBatisDataStore.register(MyBatisDataStore.java:270)
at org.sonatype.nexus.datastore.internal.DataStoreManagerImpl$DataAccessMediator.add(DataStoreManagerImpl.java:368)
at org.sonatype.nexus.datastore.internal.DataStoreManagerImpl$DataAccessMediator.add(DataStoreManagerImpl.java:1)
at org.eclipse.sisu.inject.WatchedBeans.add(WatchedBeans.java:80)
at org.eclipse.sisu.inject.InjectorBindings.publishExactMatches(InjectorBindings.java:157)
at org.eclipse.sisu.inject.InjectorBindings.subscribe(InjectorBindings.java:79)
at org.eclipse.sisu.inject.DefaultBeanLocator.watch(DefaultBeanLocator.java:80)
at org.sonatype.nexus.datastore.internal.DataStoreManagerImpl.doCreate(DataStoreManagerImpl.java:197)
at org.sonatype.nexus.datastore.internal.DataStoreManagerImpl.tryRestore(DataStoreManagerImpl.java:175)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
at org.sonatype.nexus.datastore.internal.DataStoreManagerImpl.doStart(DataStoreManagerImpl.java:124)
at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:69)
at org.sonatype.nexus.datastore.internal.DataStoreManagerImpl$$EnhancerByGuice$$710f462.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$TransitionImpl.run(StateGuard.java:206)
at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:57)
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.datastore.internal.DataStoreManagerImpl$$EnhancerByGuice$$710f462.start(<generated>)
at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:210)
at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:121)
at org.sonatype.nexus.extender.NexusContextListener.moveToPhase(NexusContextListener.java:334)
at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:231)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1597)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.lang.Thread.run(Thread.java:748)

ERROR2:
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table “MAVEN2_BROWSE_NODE” not found; SQL statement:
ALTER TABLE maven2_browse_node ALTER COLUMN node_id SET DATA TYPE BIGINT; [42102-224]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:514)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
at org.h2.message.DbException.get(DbException.java:223)
at org.h2.message.DbException.get(DbException.java:199)
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8064)
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8045)
at org.h2.command.Parser.tableIfTableExists(Parser.java:8574)
at org.h2.command.Parser.columnIfTableExists(Parser.java:8581)
at org.h2.command.Parser.parseAlterTableAlter(Parser.java:8171)
at org.h2.command.Parser.parseAlterTable(Parser.java:8157)
at org.h2.command.Parser.parseAlter(Parser.java:7211)
at org.h2.command.Parser.parsePrepared(Parser.java:650)
at org.h2.command.Parser.parse(Parser.java:592)
at org.h2.command.Parser.parse(Parser.java:564)
at org.h2.command.Parser.prepareCommand(Parser.java:483)
at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:639)
at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:559)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1166)
at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:93)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:316)
at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337)
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
at org.sonatype.nexus.repository.content.upgrades.BrowseNodeMigrationStep_1_33.migrateFormat(BrowseNodeMigrationStep_1_33.java:58)
… 39 common frames omitted

I reported this issue in September with a possible workaround: "org.h2.mvstore.MVStoreException: Chunk 44722 not found" on first Nexus start after DB migration (3.70.2) · Issue #477 · sonatype/nexus-public · GitHub

Thank you for your help. I have adopted this repair method and the service can start normally, but after starting, all Maven packages in the group are missing

nexus.log

2024-11-02 10:05:39,482+0800 WARN [periodic-5-thread-1] *SYSTEM org.apache.ibatis.executor.BaseExecutor - Unexpected exception on closing transaction. Cause: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add “;DB_CLOSE_ON_EXIT=FALSE” to the db URL) [90121-232]
2024-11-02 10:05:39,483+0800 WARN [quartz-10-thread-7] *SYSTEM org.sonatype.nexus.repository.content.search.elasticsearch.SearchFacetImpl - Error ’

Error querying database. Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column ‘ASSET_ID’ from result set. Cause: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add “;DB_CLOSE_ON_EXIT=FALSE” to the db URL) [90121-232]

The error may exist in org.sonatype.nexus.content.maven.store.Maven2AssetDAO

The error may involve org.sonatype.nexus.content.maven.store.Maven2AssetDAO.browseComponentAssets

The error occurred while handling results

SQL: SELECT * FROM maven2_asset WHERE component_id = ?;

Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column ‘ASSET_ID’ from result set. Cause: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add “;DB_CLOSE_ON_EXIT=FALSE” to the db URL) [90121-232]’ creating search document for component: namespace=lingyue, name=ecommerce-common-authorization, version=1.0.0-20240613.090421-758

2024-11-02 10:05:39,484+0800 WARN [qtp1800662326-719] *UNKNOWN org.apache.ibatis.executor.BaseExecutor - Unexpected exception on closing transaction. Cause: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add “;DB_CLOSE_ON_EXIT=FALSE” to the db URL) [90121-232]
2024-11-02 10:05:39,488+0800 WARN [quartz-10-thread-3] *SYSTEM org.apache.ibatis.executor.BaseExecutor - Unexpected exception on closing transaction. Cause: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add “;DB_CLOSE_ON_EXIT=FALSE” to the db URL) [90121-232]
2024-11-02 10:05:39,492+0800 WARN [quartz-10-thread-11] *SYSTEM org.sonatype.nexus.repository.content.search.elasticsearch.SearchFacetImpl - Error ’

Error querying database. Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column ‘ASSET_ID’ from result set. Cause: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add “;DB_CLOSE_ON_EXIT=FALSE” to the db URL) [90121-232]