quarkusio/quarkus · error · IllegalStateException
Error starting Liquibase
Error message
Error starting Liquibase
What it means
LiquibaseSchemaProvider.resetDatabase (used by the Dev Services / dev mode database reset feature) resolves the LiquibaseFactory for the named database and calls doReset (dropAll). Any exception other than UnsatisfiedResolutionException (datasource not configured, which is ignored) is rethrown as IllegalStateException('Error starting Liquibase'). The wrapped cause holds the real failure, typically from dropping the schema.
Source
Thrown at extensions/liquibase/liquibase/runtime/src/main/java/io/quarkus/liquibase/runtime/LiquibaseSchemaProvider.java:22
import io.quarkus.arc.InstanceHandle;
import io.quarkus.datasource.runtime.DatabaseSchemaProvider;
import io.quarkus.liquibase.LiquibaseFactory;
import liquibase.Liquibase;
import liquibase.exception.LiquibaseException;
public class LiquibaseSchemaProvider implements DatabaseSchemaProvider {
@Override
public void resetDatabase(String dbName) {
try {
try {
LiquibaseFactory liquibaseFactory = LiquibaseFactoryUtil.getLiquibaseFactory(dbName).get();
doReset(liquibaseFactory);
} catch (UnsatisfiedResolutionException e) {
//ignore, the DS is not configured
}
} catch (Exception e) {
throw new IllegalStateException("Error starting Liquibase", e);
}
}
@Override
public void resetAllDatabases() {
try {
for (InstanceHandle<LiquibaseFactory> liquibaseFactoryHandle : LiquibaseFactoryUtil.getActiveLiquibaseFactories()) {
try {
LiquibaseFactory liquibaseFactory = liquibaseFactoryHandle.get();
doReset(liquibaseFactory);
} catch (UnsatisfiedResolutionException e) {
//ignore, the DS is not configured
}
}
} catch (Exception e) {
throw new IllegalStateException("Error starting Liquibase", e);
}
}View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the 'Caused by' LiquibaseException for which object failed to drop.
- Close other connections to the dev database (other apps, DB clients) before resetting.
- Grant the DB user sufficient privileges to drop its schema objects.
- Ensure the datasource for dbName is properly configured and reachable.
- As a workaround, drop and recreate the dev database/container instead of reset.
Example fix
# before: reset fails due to lingering connections # after: terminate sessions first, e.g. for Postgres SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='mydb' AND pid <> pg_backend_pid(); # then trigger the reset again
Defensive patterns
Strategy: try-catch
Validate before calling
// Before resetting, ensure no other sessions hold the DB: // SELECT COUNT(*) FROM pg_stat_activity WHERE datname = 'mydb'; // and that the user can drop objects: // SELECT has_database_privilege(current_user, 'mydb', 'CREATE');
Try / catch
try {
schemaProvider.resetDatabase("mydb");
} catch (IllegalStateException e) {
if ("Error starting Liquibase".equals(e.getMessage())) {
log.error("Reset of DB '{}' failed: {}", "mydb", e.getCause().getMessage());
}
} Prevention
- Stop sibling apps/DB clients before resetting a dev database.
- Grant the dev DB user DROP privileges on its schema.
- Reset databases one at a time to isolate failures.
- Recreate the dev container (Dev Services) instead of repeated drop-all cycles.
When it happens
Trigger: Dev mode/database reset invokes resetDatabase(dbName); doReset's liquibase.dropAll() throws — active connections prevent dropping, insufficient DB privileges to DROP objects, or the changelog/datasource is misconfigured. UnsatisfiedResolutionException for an unconfigured DB is swallowed, everything else is wrapped.
Common situations: Resetting a dev database while other sessions/tables hold locks; DB user lacking DROP rights; dropping a schema with foreign keys/objects Liquibase can't remove; trying to reset a named datasource that exists but is misconfigured.
Related errors
- Unable to deserialize the dev mode context. Does the Quarkus
- Hot deployment of the application is not supported when upda
- remote-dev can only be used with mutable applications i.e. u
- Failed to create compiler
- Failed to open class path file <file>
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/1d35fcdf346b1706.
Report an issue: GitHub.