{"record":{"id":"1f2589b21fc396f3","repo":"t8y2/dbx","slug":"zookeeper-path-brokers-ids-does-not-exist","errorCode":null,"errorMessage":"ZooKeeper path /brokers/ids does not exist","messagePattern":"ZooKeeper path /brokers/ids does not exist","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java","lineNumber":356,"sourceCode":"        int connectionTimeout = intOrDefault(\n            conn,\n            \"zookeeper_connection_timeout_ms\",\n            DEFAULT_ZOOKEEPER_CONNECTION_TIMEOUT_MS\n        );\n        CountDownLatch connected = new CountDownLatch(1);\n        ZooKeeper zooKeeper = new ZooKeeper(connectString, sessionTimeout, event -> {\n            if (event.getState() == Watcher.Event.KeeperState.SyncConnected) connected.countDown();\n        }, zooKeeperClientConfig(conn));\n        try {\n            if (!connected.await(connectionTimeout, TimeUnit.MILLISECONDS)) {\n                throw new IllegalStateException(\"Timed out connecting to ZooKeeper for Kafka broker discovery\");\n            }\n\n            List<String> brokerIds;\n            try {\n                brokerIds = new ArrayList<>(zooKeeper.getChildren(\"/brokers/ids\", false));\n            } catch (KeeperException.NoNodeException e) {\n                throw new IllegalStateException(\"ZooKeeper path /brokers/ids does not exist\", e);\n            }\n            brokerIds.sort(KafkaAgent::compareBrokerIds);\n\n            List<JsonObject> registrations = new ArrayList<>();\n            for (String brokerId : brokerIds) {\n                try {\n                    byte[] data = zooKeeper.getData(\"/brokers/ids/\" + brokerId, false, null);\n                    registrations.add(JsonParser.parseString(new String(data, StandardCharsets.UTF_8)).getAsJsonObject());\n                } catch (KeeperException.NoNodeException e) {\n                    // Expected race: a broker may refresh its ephemeral node between list and read.\n                    logger().debug(\"Kafka broker {} disappeared during ZooKeeper discovery\", brokerId);\n                } catch (RuntimeException e) {\n                    logger().warn(\"Skipping malformed ZooKeeper registration for Kafka broker {}\", brokerId, e);\n                }\n            }\n            return brokerEndpoints(registrations, securityProtocol);\n        } finally {\n            zooKeeper.close();","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java#L338-L374","documentation":"Thrown by discoverBootstrapServers after a successful ZooKeeper connection when the ensemble does not contain the /brokers/ids znode. This means the connected ZooKeeper ensemble is not managing a Kafka cluster (wrong ensemble, or Kafka stores its metadata elsewhere), so no brokers can be discovered.","triggerScenarios":"Thrown at agents/drivers/kafka/src/main/java/com/dbx/agent/kafka/KafkaAgent.java:356 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm zookeeper_connect_string points to the ZooKeeper ensemble used by the Kafka cluster, not a different one","Verify the Kafka cluster is running and has registered brokers under /brokers/ids (zkCli: ls /brokers/ids)","Bypass discovery by setting bootstrap_servers directly"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}