Applies to
- Liquibase Secure (Pro)
- Liquibase Open Source (Community)
Conditions
- Running a database inspection command (i.e., 'snapshot', 'diff', 'diff-changelog', and 'generate-changelog') against a MySQL database with specific index configurations
Issue Summary
Users encounter a NullPointerException error when attempting to run a database inspection command on a MySQL database. The error occurs during the snapshot stage and prevents the Liquibase operation from completing successfully. The error message indicates that a column object is null when Liquibase attempts to invoke the getName() method on it.
Error Message
ERROR: Exception Primary Class: NullPointerException
ERROR: Exception Primary Reason: Cannot invoke "liquibase.structure.core.Column.getName()" because "column" is null
Unexpected error running Liquibase: Cannot invoke "liquibase.structure.core.Column.getName()" because "column" is null
Root Cause
This issue is caused by a bug in Liquibase versions prior to 5.0 where the snapshot functionality fails to properly handle certain index column configurations in MySQL databases.
The issue specifically occurs when Liquibase processes indexes with descending columns or specific column ordering configurations that are not properly validated before being accessed.
Resolution
Upgrade to Liquibase 5.0 or later
This issue has been resolved in Liquibase version 5.0. The fix is documented in the release notes under issue DAT-20441.
To resolve this issue:
- Upgrade to Liquibase Secure 5.0 or Liquibase Open Source 5.0 or later
- If using Liquibase Secure (formerly Liquibase Pro), review the important changes required to use Liquibase Secure.
- Re-run the snapshot command with the updated version
Note: There are no known workarounds for versions prior to 5.0. Upgrading to version 5.0 or later is the recommended solution.
Comments
0 comments
Article is closed for comments.