ActiveObjects fails to detect existing tables or create tables with MySQL JDBC Connector 8.0.11

Description

Resolution/answer

The source of the problem is a change of default configuration introduced in Connector/J 8. The property nullCatalogMeansCurrent used to be true, but was changed to false (see documentation). This breaks method calls that took catalog as an argument - instead of looking only in the current catalog, this lookup will check all catalogs and will potentially break when accessing information_schema (this might work when binding as a user who can access information_schema, but this configuration is insecure and I opted not to test it). The possible ways to set this property are highlighted here.

From the Atlassian application administrator perspective the most feasible option is adding nullCatalogMeansCurrent=true to the connection string which brings back the old behaviour.

On the Atlassian product’s support for MySQL 8: a combination of Connector/J 5.1 and MySQL 8 is officially marked as compatible in the MySQL documentation.
On the Atlassian product’s support for Connector/J 8: ActiveObjects library will expect that DB connection will be properly set up by the product.

Summary

The ActiveObjects library appears to have incompatibilities with MySQL JDBC Connector 8.0.11. It's unable to detect existing AO_ tables (after upgrade) or create new AO_ tables (for new installations, encountered at least once during Bamboo reproduction attempts). Looks like it's targeting the wrong database / schema.

Environment

  • Bamboo 6.5.0

  • Bitbucket 5.10.0

  • Fisheye/Crucible 4.5.3

  • MySQL 5.7

  • MySQL JDBC Connector 8.0.11

  • Other products unconfirmed / tested.

Steps to Reproduce

Bamboo
  1. Create two MySQL databases (grant permissions to both databases for the same user)

  2. Install Bamboo 6.5.0

  3. Copy the MySQL JDBC Connector 8 into <bamboo-install>/lib

  4. Start Bamboo and install it using one of the databases from Step 1

  5. Immediately there should be errors referencing the AO_2F1435_HEALTH_CHECK_STATUS table in the logs.

  6. Create a plan and perform a build

  7. Click the build result -> Internal Server Error regarding AO_7A45FB_AOTRACKING_ENTRY

  8. If there isn't any errors, try restarting Bamboo. There does appear to be some level of inconsistency to reproduction.

Bitbucket
  1. Install Bitbucket 5.10

  2. Copy the MySQL JDBC Connector 8 into <bitbucket-home>/lib

  3. Start Bitbucket and install it using a MySQL database

  4. Navigate to the Bitbucket URLs (errors should have already started due to background tasks)

Fisheye/Crucible
  1. Install Fisheye/Crucible 4.5.3

  2. Copy the MySQL JDBC Connector 8 into <FISHEYE_INST>/lib

  3. Start Fisheye/Crucible and complete the setup wizard

  4. Migrate to MySQL

  5. In the administration area, try accessing the 'Smart Commits' menu option on the left

Expected Results

AO tables are found in the correct schema and created.

Actual Results

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

  • Many other AO tables such as AO_777666_JIRA_INDEX, AO_D6A508_IMPORT_JOB and AO_92D5D5_REPO_NOTIFICATION will also present the same error without any action in the UI. Presumably background tasks.

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

Note, the schema bamboo1 is not the one defined in the JDBC connection string, it's another database:

If we then go and drop bamboo1 (empty db created for reproduction purposes), it starts looking in sys schemas such as information_schema instead:

The below exception is thrown in the atlassian-fisheye.log file after clicking on the 'Smart Commits' menu:

The atlassian-fisheye.log also report problems with the AO_2913F5_COMMENT_ISSUE Active Objects table:

Workaround

Downgrade the JDBC connector to 5.1.46 and restart the application:

Environment

None

Testing Notes

Add notes...

Status

Assignee

Patryk Petrowski

Reporter

Jeremy Owen

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Priority

Major
Configure