quarkusio/quarkus · critical · IllegalArgumentException

<errorMessage>.formatted(clientName) (required Liquibase Mon

Error message

<errorMessage>.formatted(clientName) (required Liquibase MongoDB config missing for client)

What it means

LiquibaseMongodbRecorder.getRequiredConfig looks up a per-client map entry keyed by clientName during recorded startup actions; if the entry is missing it throws IllegalArgumentException with the supplied formatted message (required Liquibase MongoDB config missing for client <name>). It is called from buildTimeClientConfig, liquibaseMongodbClientConfig, and the supplier's get(), meaning both build-time and runtime lookups enforce presence. The error guards against silent nulls when a named client has no Liquibase configuration.

Source

Thrown at extensions/liquibase/liquibase-mongodb/runtime/src/main/java/io/quarkus/liquibase/mongodb/runtime/LiquibaseMongodbRecorder.java:40

    private final LiquibaseMongodbBuildTimeConfig buildTimeConfig;
    private final RuntimeValue<LiquibaseMongodbConfig> runtimeConfig;
    private final RuntimeValue<MongoConfig> mongodbRuntimeConfig;

    public LiquibaseMongodbRecorder(
            final LiquibaseMongodbBuildTimeConfig buildTimeConfig,
            final RuntimeValue<LiquibaseMongodbConfig> runtimeConfig,
            final RuntimeValue<MongoConfig> mongodbRuntimeConfig) {
        this.buildTimeConfig = buildTimeConfig;
        this.runtimeConfig = runtimeConfig;
        this.mongodbRuntimeConfig = mongodbRuntimeConfig;
    }

    public Supplier<LiquibaseMongodbFactory> liquibaseSupplier(String clientName) {
        return new Supplier<LiquibaseMongodbFactory>() {
            private <T> T getRequiredConfig(Map<String, T> map, String errorMessage) {
                T value = map.get(clientName);
                if (value == null) {
                    throw new IllegalArgumentException(errorMessage.formatted(clientName));
                }
                return value;
            }

            @Override
            public LiquibaseMongodbFactory get() {
                LiquibaseMongodbBuildTimeClientConfig buildTimeClientConfig = getRequiredConfig(
                        buildTimeConfig.clientConfigs(),
                        "Liquibase Mongo config (changeLog) named '%s' not found");

                LiquibaseMongodbClientConfig liquibaseMongodbClientConfig = getRequiredConfig(
                        runtimeConfig.getValue().clientConfigs(),
                        "Liquibase Mongo client config named '%s' not found");

                MongoClientConfig mongoClientConfig;
                String clientNameSelected;
                if (liquibaseMongodbClientConfig.mongoClientName().isPresent()) {
                    // keep compatibility with the legacy configuration which makes possible set the mongo-client-name

View on GitHub (pinned to e1c734241f)

Solutions

  1. Define the missing config block for the named client, e.g. quarkus.liquibase-mongodb.<client-name>.change-log=... and its quarkus.mongodb.<client-name>.* settings
  2. Make sure client names in quarkus.liquibase-mongodb.<client-name>.* exactly match those in quarkus.mongodb.<client-name>.* (check spelling)
  3. If the client is unused, remove the stale reference / disable its start actions instead of leaving a half-configured client
  4. After Quarkus config changes, rebuild — build-time config keys are fixed at augmentation time

Example fix

# before (client 'audit' referenced but undefined)
# after
quarkus.mongodb.audit.connection-string=mongodb://localhost:27017/auditdb
quarkus.liquibase-mongodb.audit.change-log=db/changelog/audit-changelog.yaml
Defensive patterns

Strategy: validation

Validate before calling

// Before startup, ensure every referenced client has both mongodb and liquibase-mongodb config
java.util.Set<String> liquibaseClients = allKeysMatching("quarkus.liquibase-mongodb.\\w+.change-log");
java.util.Set<String> mongoClients = allKeysMatching("quarkus.mongodb.\\w+.connection-string");
for (String c : liquibaseClients) {
    if (!mongoClients.contains(c)) {
        throw new IllegalStateException("Client '" + c + "' referenced by liquibase-mongodb has no quarkus.mongodb." + c + " config");
    }
}

Try / catch

try {
    startApplication();
} catch (IllegalArgumentException e) {
    if (e.getMessage() != null && e.getMessage().contains("required Liquibase MongoDB config missing")) {
        // extract client name from message, add quarkus.liquibase-mongodb.<name>.* and quarkus.mongodb.<name>.* blocks
    }
    throw e;
}

Prevention

When it happens

Trigger: A Liquibase supplier is recorded for clientName 'X' but the runtime config maps (clients configs for quarkus.liquibase-mongodb.<client>.* or quarkus.mongodb.<client>.*) contain no entry for 'X' — e.g. referencing a client name in quarkus.liquibase-mongodb.<name>.change-log that was never defined, or removing a client from config while start actions still reference it.

Common situations: Renaming a MongoDB client in config but leaving the old name in liquibase-mongodb properties; multiple named clients where one block was deleted; typos in the client name key; using only default (quarkus.liquibase-mongodb.*) config while code expects a named client entry.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/91c3d459dc8f970b. Report an issue: GitHub.