Database migration failed
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
The following appears in the atlassian-bitbucket.log
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2013-01-24 07:24:22,259 INFO [NioProcessor-4] org.apache.sshd.server.kex.DHG14 Received SSH_MSG_KEXDH_INIT
2013-01-24 07:24:22,259 INFO [NioProcessor-3] org.apache.sshd.server.kex.DHG14 Received SSH_MSG_KEXDH_INIT
2013-01-24 07:24:22,260 DEBUG [threadpool:thread-8] admin 443x1342x1 1l6k8gy 86.86.65.13 "POST /admin/db/edit HTTP/1.1" c.a.s.i.backup.AbstractBackupSupport Successfully deleted unpacked files from /home/admin/bitbucket-home/tmp/migration-admin-20130124-072356-019.zip-unpack5677593955209237819.backup
2013-01-24 07:24:22,266 ERROR [threadpool:thread-8] admin 443x1342x1 1l6k8gy 86.86.65.13 "POST /admin/db/edit HTTP/1.1" c.a.s.i.m.DefaultMigrationService Reverting database configuration after a failed migration attempt
com.atlassian.activeobjects.spi.ActiveObjectsImportExportException: There was an error during import/export with plugin Atlassian Bitbucket Server SSH Plugin(com.atlassian.bitbucket.ssh-plugin) #2.0.0 (table AO_FB71B4_PUBLIC_KEY):Error executing update for SQL statement 'CREATE TABLE AO_FB71B4_PUBLIC_KEY (
ID INTEGER AUTO_INCREMENT,
KEY_MD5 VARCHAR(255),
KEY_TEXT TEXT,
USER_ID INTEGER,
PRIMARY KEY(ID)
) ENGINE=InnoDB'
at com.atlassian.activeobjects.backup.ImportExportErrorServiceImpl.newImportExportSqlException(ImportExportErrorServiceImpl.java:30) ~[na:na]
at com.atlassian.activeobjects.backup.SqlUtils.onSqlException(SqlUtils.java:53) ~[na:na]
at com.atlassian.activeobjects.backup.SqlUtils.executeUpdate(SqlUtils.java:42) ~[na:na]
at com.atlassian.activeobjects.backup.ActiveObjectsTableCreator.create(ActiveObjectsTableCreator.java:84) ~[na:na]
...
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'AO_FB71B4_PUBLIC_KEY' already exists
Cause
Race condition occurs when a git client attempts to interact with Bitbucket Server via SSH while the migration is in progress.
Workaround
Recreate the target database to have an empty database
Shut down the SSH server on the
Administration >> Server Settings
pagePerform the database migration
Start the SSH server back up
Resolution
Upgrade to Bitbucket Server 2.1.0+ that has fixed the bug BSERV-3053 - Race condition causes migration failure due to SSH server creating public key table before restore code does.
Was this helpful?