Skip to content
Latchkey

Liquibase "Rollback failed" / Missing Rollback in CI

Liquibase tried to roll back a changeset and could not. Either the change has no automatic inverse (e.g. sql/dropColumn with data) and no explicit <rollback>, or the rollback SQL itself errored. This is about the changeset definition, not connectivity.

What this error means

liquibase rollback/rollbackCount/updateTestingRollback fails reporting it cannot compute an inverse, or the rollback statements error. It is deterministic for a given changeset.

liquibase output
Unexpected error running Liquibase: liquibase.exception.RollbackImpossibleException:
No inverse to liquibase.change.core.RawSQLChange could be calculated

Common causes

Change has no automatic inverse

Raw sql, dropTable, or data changes cannot be auto-reversed. Without an explicit <rollback> block, Liquibase cannot roll them back.

Rollback SQL itself fails

A provided rollback that references an object that no longer exists, or has a SQL error, fails when executed.

updateTestingRollback in CI exercises rollback

updateTestingRollback applies, rolls back, then re-applies each changeset - so a missing/broken rollback surfaces in CI even if normal updates pass.

How to fix it

Add an explicit rollback to the changeset

Define how to reverse changes that have no automatic inverse.

changelog.xml
<changeSet id="add-orders-status" author="alice">
  <addColumn tableName="orders">
    <column name="status" type="text"/>
  </addColumn>
  <rollback>
    <dropColumn tableName="orders" columnName="status"/>
  </rollback>
</changeSet>

Fix or test the rollback SQL

  1. Run liquibase updateTestingRollback in CI to exercise each rollback.
  2. Correct rollback statements that reference now-missing objects.
  3. For irreversible data changes, document that rollback is not supported rather than leaving a broken block.

How to prevent it

  • Provide <rollback> for any change without an automatic inverse.
  • Run updateTestingRollback in CI to validate rollbacks.
  • Treat rollback definitions as part of the changeset, reviewed together.

Frequently asked questions

What causes ""No inverse / rollback" failure"?
Raw sql, dropTable, or data changes cannot be auto-reversed. Without an explicit <rollback> block, Liquibase cannot roll them back.
How do I fix "No inverse / rollback" failure?
Define how to reverse changes that have no automatic inverse.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card