Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-12954

Migrating database using the migration wizard can fail with ArrayIndexOutOfBoundsException

    XMLWordPrintable

Details

    Description

      Issue Summary

      Due to bugs in the Apache Xerces library (XERCESJ-1257, XERCESJ-1655) that is used in parsing XML files for database migration, migrating a database using the database migration wizard can fail. 

      Steps to Reproduce

      No steps are currently available to generate a database schema from scratch that is able to reproduce this issue. However it can occur when using the database migration wizard to migrate a Bitbucket database

      Expected Results

      No exceptions being thrown when using the database migration wizard

      Actual Results

      The below exception is thrown in the atlassian-bitbucket.log file:

      java.lang.ArrayIndexOutOfBoundsException: Index 2048 out of bounds for length 2048
      	at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
      	at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
      	at org.apache.xerces.impl.XMLEntityScanner.scanData(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanCDATASection(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      	at com.atlassian.security.xml.RestrictedXMLReader.parse(RestrictedXMLReader.java:103)
      	at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseMigrationDao.parse(DefaultLiquibaseMigrationDao.java:223)
      	at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseMigrationDao.scan(DefaultLiquibaseMigrationDao.java:215)
      	at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseMigrationDao.restore(DefaultLiquibaseMigrationDao.java:177)
      	at com.atlassian.stash.internal.maintenance.restore.DatabaseRestoreStep.run(DatabaseRestoreStep.java:95)
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ysun Yingran Sun
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: