Liquibase "Unexpected error running Liquibase" in CI
"Unexpected error running Liquibase" is the generic prefix Liquibase prints for many failures. The actionable detail follows it: a failed SQL statement, a changelog that cannot be found or parsed, or a missing property.
What this error means
liquibase update exits non-zero with "Unexpected error running Liquibase:" followed by a specific message, for example a missing changelog file or a SQL error.
Unexpected error running Liquibase: liquibase.exception.ChangeLogParseException:
The file db/changelog/db.changelog-master.xml was not found in the configured search pathCommon causes
The changelog file or search path is wrong
The master changelog cannot be found at the configured path in the CI checkout, so parsing fails before any changeset runs.
A changeset SQL or parse error
A statement inside a changeset fails, or the changelog cannot be parsed, and Liquibase wraps it in the generic message.
How to fix it
Read the message after the prefix
- Look at the text after "Unexpected error running Liquibase:"; it names the real problem.
- For a missing changelog, fix
--changelog-file/searchPathto point at the file in the repo. - For a SQL or parse error, correct the offending changeset.
liquibase --changelog-file=db/changelog/db.changelog-master.xml updateVerify the changelog path in CI
Confirm the working directory and search path match where the changelog lives in the checkout.
How to prevent it
- Always read the specific error after the generic prefix.
- Pin
--changelog-fileand search path to the repo layout. - Test the changelog runs from a clean checkout in CI.