Liquibase "Could not acquire change log lock" in CI
Liquibase takes a row in DATABASECHANGELOGLOCK so two runs cannot migrate at once. If a previous run was killed before releasing it, the lock stays set and the next run cannot acquire it - or two runs genuinely overlap.
What this error means
A Liquibase step fails (or hangs printing "Waiting for changelog lock....") with "Could not acquire change log lock", naming who holds it and since when. It commonly follows a cancelled or OOM-killed job.
Liquibase Community ... could not acquire change log lock.
Currently locked by runner-7 (10.0.0.7) since 2026-06-25 09:14
liquibase.exception.LockException: Could not acquire change log lock.Common causes
Stale lock from a killed run
A cancelled, timed-out, or OOM-killed run never released the lock, so the DATABASECHANGELOGLOCK row stays locked and blocks the next run.
Concurrent migrations
Two pipelines migrating the same database at once legitimately contend for the lock.
How to fix it
Release a stale lock
When no other migration is active, release the lock so the next run can acquire it.
liquibase releaseLocks
liquibase updateSerialize migrations
- Put migration jobs in a CI concurrency group so only one runs at a time.
- Avoid two pipelines targeting the same database concurrently.
- Set a step timeout so a stuck lock surfaces fast.
How to prevent it
- Constrain migration jobs with a concurrency group so they cannot overlap.
- Clear stale locks at the start of a controlled, single-writer deploy.
- On managed runners (Latchkey), self-healing auto-retries transient lock-contention failures so a briefly-held lock can clear.