{"record":{"id":"9726f50ba7e778f5","repo":"prestodb/presto","slug":"pinot-unable-to-find-broker","errorCode":"PINOT_UNABLE_TO_FIND_BROKER","errorMessage":"Cannot parse %s in the broker instance","messagePattern":"Cannot parse (.+?) in the broker instance","errorType":"error_code","errorClass":"PinotException","httpStatus":null,"severity":"error","filePath":"presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotClusterInfoFetcher.java","lineNumber":317,"sourceCode":"    }\n\n    @VisibleForTesting\n    List<String> getAllBrokersForTable(String table)\n    {\n        String responseBody = sendHttpGetToController(String.format(TABLE_INSTANCES_API_TEMPLATE, table));\n        ArrayList<String> brokers = brokersForTableJsonCodec\n                .fromJson(responseBody)\n                .getBrokers()\n                .stream()\n                .flatMap(broker -> broker.getInstances().stream())\n                .distinct()\n                .map(brokerToParse -> {\n                    Matcher matcher = BROKER_PATTERN.matcher(brokerToParse);\n                    if (matcher.matches() && matcher.groupCount() == 2) {\n                        return matcher.group(1) + \":\" + matcher.group(2);\n                    }\n                    else {\n                        throw new PinotException(\n                                PINOT_UNABLE_TO_FIND_BROKER,\n                                Optional.empty(),\n                                String.format(\"Cannot parse %s in the broker instance\", brokerToParse));\n                    }\n                })\n                .collect(Collectors.toCollection(() -> new ArrayList<>()));\n        Collections.shuffle(brokers);\n        return ImmutableList.copyOf(brokers);\n    }\n\n    public String getBrokerHost(String table)\n    {\n        try {\n            List<String> brokers = brokersForTableCache.get(table);\n            if (brokers.isEmpty()) {\n                throw new PinotException(PINOT_UNABLE_TO_FIND_BROKER, Optional.empty(), \"No valid brokers found for \" + table);\n            }\n            return brokers.get(ThreadLocalRandom.current().nextInt(brokers.size()));","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotClusterInfoFetcher.java#L299-L335","documentation":"Thrown when a broker entry returned by the Pinot controller's broker table list cannot be parsed with the expected BROKER_PATTERN (host:port format, two groups). The connector must extract host and port from each broker string to route queries; an unparseable entry makes broker discovery fail.","triggerScenarios":"getAllBrokersForTable maps each broker string from the controller response through BROKER_PATTERN.matcher(); if the entry does not fully match with exactly 2 groups (e.g. 'Server_pinot-broker-0_7000' vs expected 'host:port' pattern variants), this is thrown.","commonSituations":"Pinot cluster upgrades changing the broker instance naming format, broker instances registered in an unexpected state (starting/failed), connector expecting one broker tag format while the cluster uses another (e.g. tenant brokers, legacy naming).","solutions":["Call the controller endpoint directly (e.g. /tables/{table}/brokers) and inspect the raw broker strings to see the actual format","Check that the Presto connector's Pinot version matches your Pinot cluster version — broker naming conventions changed across releases","Verify all brokers for the table are registered in a healthy state in the Pinot cluster state (Zookeeper), not partially started","Update the connector (or Pinot) so BROKER_PATTERN matches the deployed broker instance format"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// Verify broker list format before querying via Presto\n// curl http://<controller>:9000/tables/<table>/brokers\n// assert each entry parses as the expected host:port pattern","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Pinot cluster and connector versions aligned with broker naming conventions","Ensure brokers are fully started and registered in a healthy state before query traffic","Check Zookeeper broker instance entries after Pinot upgrades"],"tags":["pinot","broker-discovery","format-mismatch","version-compatibility"],"backgroundTag":"broker-instance-parse-failed","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}