How can I recovery the H2 database and why got this exception?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 18/100
Research direction
Start by reviewing the H2 Recover and RunScript commands against the Nexus 3.70.1 recovery procedure, then inspect the reported ROLES deserialization failure. The payload names org/sonatype/nexus/internal/security/model/CUserRoleMappingDAO.xml and DataAccessSqlSession.java; done means identifying whether the failure is caused by recovery output or belongs in Nexus rather than H2.
Written by the indexing model from the issue text.
Description
Hello all, I am trying to recover h2 database for nexus 3.70.1
Setup:
Nexus Version: 3.70.1
H2 Version: 2.2.224
java Version: 11
Steps followed to recover H2 database
Step1
Scale Down the Pod and go into debug container
Step2
java -cp /plza/sonatype/nexus/system/com/h2database/h2/2.2.224/h2-2.2.224.jar
org.h2.tools.Recover
-dir /nexus-data/db
-db nexus
After above command. nexus.h2.sql file will be generated
/nexus-data/db/nexus.h2.sql
/nexus-data/db/nexus.h2.log
Step3
mv /nexus-data/db/nexus.mv.db /nexus-data/db/nexus.mv.db.broken
Setp4
java -cp /plza/sonatype/nexus/system/com/h2database/h2/2.2.224/h2-2.2.224.jar
org.h2.tools.RunScript
-url "jdbc:[h2:/nexus-data/db/nexus]"
-user sa -password ""
-script /nexus-data/db/nexus.h2.sql
Step5
Come out of debug pod and scale up the pod.
Error i got
` ... 48 common frames omitted
2025-12-08 11:15:09,079+0100 ERROR [FelixStartLevel] *SYSTEM org.sonatype.nexus.extender.NexusContextListener - Failed to start nexus
org.sonatype.nexus.datastore.api.DataAccessException:
Error querying database. Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'ROLES' from result set. Cause: java.sql.SQLException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type java.util.HashSet<java.lang.Object> from String value (token JsonToken.VALUE_STRING)
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 1]
The error may exist in org/sonatype/nexus/internal/security/model/CUserRoleMappingDAO.xml
The error may involve org.sonatype.nexus.internal.security.model.CUserRoleMappingDAO.read
The error occurred while handling results
SQL: SELECT * FROM user_role_mapping WHERE user_id = ? AND source = ?;
Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'ROLES' from result set. Cause: java.sql.SQLException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type java.util.HashSet<java.lang.Object> from String value (token JsonToken.VALUE_STRING)
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 1]
at org.sonatype.nexus.datastore.mybatis.DataAccessSqlSession.unwrapMyBatisException(DataAccessSqlSession.java:125)
at org.sonatype.nexus.datastore.mybatis.DataAccessSqlSession.selectList(DataAccessSqlSession.java:76)`
- Dominant language
- Java
- Stars
- 4.6k
- Forks
- 1.3k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 27
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from h2database/h2database
-
It's not necessary to copy the memory block in the readWrite() of org.h2.store.fs.mem.FileMemDataOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
h2database/h2database#4435 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
h2database/h2database#4354 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
h2database/h2database#4425 · 3 comments ·
Maintainers usually reply within 1 day
-
BUG: Parenthesized UNION term returns stale result when only its FETCH / OFFSET / ORDER BY parameter changesPossibly taken @kalayciburak claimed this 8 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 76/100
h2database/h2database#4421 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
h2database/h2database#4408 ·
Maintainers usually reply within 1 day
All issues in h2database/h2database
Similar issues
-
[Bug] Logo style setting missing and `classic` style not applied across multiple platforms (v3.1.0)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Stirling-Tools/Stirling-PDF#8382 · 1 reaction ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
Maintainers usually reply within 4 days
-
enhancement untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opensearch-project/sql#5842 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
openhab/openhab-addons#21882 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
YunaiV/ruoyi-vue-pro#1273 ·
Maintainers usually reply within 3 days