Spring Boot Liquibase "Validation Failed" checksum in CI
Spring Boot runs Liquibase on startup. A ValidationFailedException means a changeSet recorded in DATABASECHANGELOG was edited after it ran, so its stored MD5 checksum no longer matches the changelog.
What this error means
Startup fails with "liquibase.exception.ValidationFailedException: Validation Failed: 1 changesets check sum" naming a changeSet whose checksum differs.
liquibase.exception.ValidationFailedException: Validation Failed:
1 changesets check sum
db/changelog/002-add-status.xml::2::alice was: 8:abc... but is now: 8:def...Common causes
An executed changeSet was modified
The body of a changeSet already in DATABASECHANGELOG changed, so the recomputed checksum no longer matches the stored one.
A formatting or logic change altered the checksum
Even reformatting SQL inside a ran changeSet changes its MD5, tripping validation on a persistent DB.
How to fix it
Add a new changeSet instead of editing
- Restore the modified changeSet to its original content.
- Express the change as a new changeSet with a unique id.
- Re-run so validation passes.
<changeSet id="3" author="alice">
<addColumn tableName="orders"><column name="status" type="varchar(32)"/></addColumn>
</changeSet>Clear checksums only if the change is intentional
When you deliberately changed a changeSet, clear stored checksums so Liquibase recomputes them.
liquibase clearCheckSumsHow to prevent it
- Treat executed changeSets as immutable.
- Run Liquibase against a fresh CI database to catch drift early.
- Review changelog diffs so edits to ran changeSets are caught.