t8y2/dbx · error · IllegalArgumentException

Kafka broker does not support " + op.opType() + " config ope

Error message

Kafka broker does not support " + op.opType() + " config operations through the legacy alterConfigs API

What it means

When altering topic/broker configs, the agent may fall back to the legacy AdminClient.alterConfigs API, which only supports SET and DELETE semantics — it replaces the whole config rather than incrementally appending/subtracting values. If a caller submits an AlterConfigOp with opType APPEND or SUBTRACT through this path, the agent throws IllegalArgumentException because legacy brokers cannot express those operations.

Source

Thrown at agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:957

        return Collections.singletonMap("ok", true);
    }

    static Map<String, String> legacyTopicConfig(Config current, List<AlterConfigOp> ops) {
        Map<String, String> values = new LinkedHashMap<>();
        for (ConfigEntry entry : current.entries()) {
            boolean topicOverride = entry.source() == ConfigEntry.ConfigSource.DYNAMIC_TOPIC_CONFIG
                || entry.source() == ConfigEntry.ConfigSource.UNKNOWN;
            if (topicOverride && !entry.isReadOnly() && !entry.isSensitive() && entry.value() != null) {
                values.put(entry.name(), entry.value());
            }
        }

        for (AlterConfigOp op : ops) {
            String key = op.configEntry().name();
            switch (op.opType()) {
                case SET -> values.put(key, op.configEntry().value());
                case DELETE -> values.remove(key);
                case APPEND, SUBTRACT -> throw new IllegalArgumentException(
                    "Kafka broker does not support " + op.opType() + " config operations through the legacy alterConfigs API"
                );
            }
        }
        return values;
    }

    // -----------------------------------------------------------------------
    // Consumer groups
    // -----------------------------------------------------------------------

    private static Object listConsumerGroups(JsonObject params) throws Exception {
        AdminClient admin = requireAdmin();
        int timeout = requestTimeout(params);
        String filterTopic = stringOrEmpty(params, "topic");

        Collection<ConsumerGroupListing> groups = admin.listConsumerGroups(
                new ListConsumerGroupsOptions().timeoutMs(timeout))

View on GitHub (pinned to c0390bff16)

Solutions

  1. Upgrade the Kafka brokers to >= 2.3 so incrementalAlterConfigs supports APPEND/SUBTRACT natively.
  2. Rewrite the operation as SET/DELETE: read the current config value, compute the resulting list locally, and submit a single SET op with the full new value.
  3. Gate the code path: detect broker capability and only send APPEND/SUBTRACT when the incremental API is available; otherwise error before sending ops.
  4. Remove APPEND/SUBTRACT ops from the request if the target value can be expressed as a plain SET.

Example fix

// before
ops.add(new AlterConfigOp(new ConfigEntry("metric.reporters", "r2"), AlterConfigOp.OpType.APPEND)); // legacy broker
// after
String current = describeConfig("metric.reporters");
ops.add(new AlterConfigOp(new ConfigEntry("metric.reporters", current + ",r2"), AlterConfigOp.OpType.SET));
Defensive patterns

Strategy: fallback

When it happens

Trigger: Calling the agent's config-alter operation (incrementalAlterConfigs) against a broker that predates incrementalAlterConfigs (Kafka < 2.3) or where the incremental API is unavailable, with ops containing APPEND or SUBTRACT op types.

Common situations: Running against an old Kafka broker or a managed service/mirror that does not expose the incremental alter API; code written for modern Kafka (using append/subtract to grow list-type configs like allowed.retention.ms lists) reused unchanged against a legacy cluster.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/9f58408360144f93. Report an issue: GitHub.