Issue migrating to Postgresql

Richard Harvey July 24, 2017

Hi there,

We're trying to migrate from the build in database to Postgresql 9.6

Unfortunatly everytime we try to do it the process fails.

These are Bitbucket logs...

2017-07-24 17:23:50,771 WARN  [threadpool:thread-1] admin @XB7B6Wx1043x48x0 2ogip0 109.232.61.200,127.0.0.1 "POST /admin/db/edit HTTP/1.1" c.a.s.i.m.DefaultMaintenanceTaskMonitor MIGRATION maintenance has failed (Cause: MigrationException: Bitbucket could not be migrated to the new database. Some data may have already been written to the new database leaving it in an inconsistent state. You will need to empty or recreate the new database before trying again.)
com.atlassian.stash.internal.migration.MigrationException: Bitbucket could not be migrated to the new database. Some data may have already been written to the new database leaving it in an inconsistent state. You will need to empty or recreate the new database before trying again.
        at com.atlassian.stash.internal.maintenance.migration.DatabaseMigrationTask.convertToMigrationException(DatabaseMigrationTask.java:86)
        at com.atlassian.stash.internal.maintenance.migration.DatabaseMigrationTask.run(DatabaseMigrationTask.java:51)
        at com.atlassian.stash.internal.maintenance.DefaultMaintenanceTaskMonitor.run(DefaultMaintenanceTaskMonitor.java:212)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.atlassian.stash.internal.concurrent.DefaultTransferableStateManager$StateTransferringRunnable.run(DefaultTransferableStateManager.java:166)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.lang.Thread.run(Thread.java:745)
        ... 1 frame trimmed
Caused by: com.atlassian.stash.internal.backup.BackupException: A backup file could not be created.
        at com.atlassian.stash.internal.maintenance.backup.BackupPhase.run(BackupPhase.java:77)
        at com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask$Step.run(CompositeMaintenanceTask.java:130)
        at com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask.run(CompositeMaintenanceTask.java:69)
        at com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask$Step.run(CompositeMaintenanceTask.java:130)
        at com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask.run(CompositeMaintenanceTask.java:69)
        at com.atlassian.stash.internal.maintenance.MaintenanceModePhase.run(MaintenanceModePhase.java:27)
        at com.atlassian.stash.internal.maintenance.migration.BaseMigrationTask.run(BaseMigrationTask.java:68)
        at com.atlassian.stash.internal.maintenance.migration.DatabaseMigrationTask.run(DatabaseMigrationTask.java:49)
        ... 11 common frames omitted
Caused by: org.hsqldb.HsqlException: lob is no longer valid
        at org.hsqldb.error.Error.error(Unknown Source)
        at org.hsqldb.error.Error.error(Unknown Source)
        at org.hsqldb.persist.LobManager.getLength(Unknown Source)
        at org.hsqldb.Session.performLOBOperation(Unknown Source)
        at org.hsqldb.Session.execute(Unknown Source)
        at org.hsqldb.types.ClobDataID.length(Unknown Source)
        at org.hsqldb.jdbc.JDBCResultSet.getString(Unknown Source)
        at com.zaxxer.hikari.pool.HikariProxyResultSet.getString(HikariProxyResultSet.java)
        at liquibase.util.JdbcUtils.getResultSetValue(JdbcUtils.java:100)
        at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseDao.getValue(DefaultLiquibaseDao.java:458)
        at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseDao.forCurrentRow(DefaultLiquibaseDao.java:448)
        at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseDao.forEachRow(DefaultLiquibaseDao.java:207)
        at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseMigrationDao.writeXmlForTable(DefaultLiquibaseMigrationDao.java:137)
        at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseMigrationDao.writeXmlForTables(DefaultLiquibaseMigrationDao.java:121)
        at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseMigrationDao.backup(DefaultLiquibaseMigrationDao.java:74)
        at com.atlassian.stash.internal.maintenance.backup.DatabaseBackupStep.run(DatabaseBackupStep.java:82)
        at com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask$Step.run(CompositeMaintenanceTask.java:130)
        at com.atlassian.stash.internal.maintenance.CompositeMaintenanceTask.run(CompositeMaintenanceTask.java:69)
        at com.atlassian.stash.internal.maintenance.backup.BackupPhase.run(BackupPhase.java:73)
        ... 18 common frames omitted


and on the postgres side we get just get the following logs...

2017-07-24 17:23:41.418 BST [7627] stashdb3@stashdb3 STATEMENT:  select count(*) from public.databasechangeloglock
2017-07-24 17:26:34.195 BST [7703] postgres@postgres ERROR:  relation "public.databasechangeloglock" does not exist at character 22


Neither of which come accross as being particularly helpful.

2 answers

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2017

Hi Richard! I've seen you already have a Support ticket regarding this issue and you're already getting assistance there. If you need anything else, please contact us via that ticket and be'll be more than happy to continue helping you.

Best regards :)

Ana 

 

 

Peter D. May 23, 2019

Running into this same issue. What solution worked for you?

Greg Wajszczuk May 23, 2019

Hi Peter

 

We decided it will be quicker to set up a clean Bitbucket installation and migrate git repositories using git commands. One of our developers wrote a script to do that.

Greg

Like Peter D. likes this
0 votes
Richard Harvey July 27, 2017

Hi there,

Haven't had any replies on this.

Does anyone know if there's an issue migrating to postgres 9.6 on the latest version of Stash?

 

Thanks

Richard

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events