Details
-
Bug
-
Resolution: Unresolved
-
High
-
None
-
8.15.0, 8.16.0, 8.17.0, 8.18.0, 8.19.0
-
None
-
1
-
Severity 3 - Minor
-
1
-
Description
Issue Summary
When upgrading a Mirror from an older version of Bitbucket to v8.15 and above, if the Migrate H2 database process is skipped and upgraded directly, the Bitbucket mirror, even when pointed to the correct $BITBUCKET_HOME directory where the old mirror data exists, will start up as a new Mirror(showing Setup Page) rather than upgrading the existing one.
This is reproducible on Data Center: YES
Steps to Reproduce
- Install Bitbucket 7.21.x Mirror
- Connect it to Primary, Authorize, and Synchronize some Repos
- Upgrade the Mirror to any Bitbucket version >=8.15.x by pointing the $BITBUCKET_HOME to the same $BITBUCKET_HOME used by the Bitbucket 7.21.x Mirror
- Bitbucket, after the upgrade, will start up but will start as a fresh install rather than upgrading the existing 7.21.x Mirror
Expected Results
Since the Migrate H2 database was skipped Bitbucket startup should have identified the H2 Manual Migration was skipped and thrown an UnsupportedH2StoreException informing the H2 DB must be Upgraded
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.stash.internal.jdbc.DataSourceConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.stash.internal.jdbc.UnsupportedH2StoreException: H2 DB file format is no longer supported
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
... 5 common frames omitted
Caused by: com.atlassian.stash.internal.jdbc.UnsupportedH2StoreException: H2 DB file format is no longer supported
at com.atlassian.stash.internal.jdbc.H2DatabaseValidator.validate(H2DatabaseValidator.java:39)
at com.atlassian.stash.internal.jdbc.DefaultDataSourceConfigurationFactory.create(DefaultDataSourceConfigurationFactory.java:81)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
... 5 common frames omitted
Actual Results
No Errors in the Logs Bitbucket Startups Up as Fresh Installation even when the $BITBUCKET_HOME has the old H2 DB and the Git data.
Workaround
- This issue only happens if the mandatory Migrate H2 database step was skipped.
- If you skipped that step, you will encounter this issue, and the fix is to shut down Bitbucket and follow the steps from the Migrate H2 database KB.