t8y2/dbx · error · IllegalArgumentException

bootstrap_servers is required

Error message

bootstrap_servers is required

What it means

Thrown by KafkaAgent.bootstrapServers when the connection object carries neither a 'bootstrap_servers' nor a 'bootstrapServers' key with a non-blank value. Every Kafka client built by this agent (admin client, producer, peek consumer) calls this helper, so all client construction fails until an initial broker address list is supplied.

Source

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

        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers(conn));
        props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
            "org.apache.kafka.common.serialization.StringSerializer");
        props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,
            "org.apache.kafka.common.serialization.ByteArraySerializer");
        props.put(ProducerConfig.ACKS_CONFIG, "all");
        // Kafka 3.x enables idempotence by default, which rejects pre-0.11 brokers.
        props.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, "false");
        applyConnectionProperties(conn, props);
        return props;
    }

    private static String bootstrapServers(JsonObject conn) {
        String servers = stringOrEmpty(conn, "bootstrap_servers");
        if (servers.isBlank()) {
            servers = stringOrEmpty(conn, "bootstrapServers");
        }
        if (servers.isBlank()) {
            throw new IllegalArgumentException("bootstrap_servers is required");
        }
        return servers;
    }

    static JsonObject resolveBrokerConnection(JsonObject conn) throws Exception {
        String configured = stringOrEmpty(conn, "bootstrap_servers");
        if (configured.isBlank()) configured = stringOrEmpty(conn, "bootstrapServers");
        if (!configured.isBlank()) return conn;

        String connectString = stringOrEmpty(conn, "zookeeper_connect_string");
        if (connectString.isBlank()) connectString = stringOrEmpty(conn, "zookeeperServers");
        if (connectString.isBlank()) {
            throw new IllegalArgumentException("bootstrap_servers or zookeeper_connect_string is required");
        }

        JsonObject resolved = conn.deepCopy();
        resolved.addProperty("bootstrap_servers", discoverBootstrapServers(connectString, securityProtocol(conn), conn));
        return resolved;

View on GitHub (pinned to c0390bff16)

Solutions

  1. Set bootstrap_servers in the connection configuration to a comma-separated host:port list of Kafka brokers, e.g. broker1:9092,broker2:9092
  2. If using the camelCase alias bootstrapServers, ensure the value is non-empty after trimming
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:314 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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