{"record":{"id":"2267d8148cace944","repo":"prestodb/presto","slug":"pinot-http-error","errorCode":"PINOT_HTTP_ERROR","errorMessage":"Unexpected response status: %d for request %s to url %s, with headers %s, full response %s","messagePattern":"Unexpected response status: (.+?) for request (.+?) to url (.+?), with headers (.+?), full response (.+?)","errorType":"error_code","errorClass":"PinotException","httpStatus":null,"severity":"error","filePath":"presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotClusterInfoFetcher.java","lineNumber":193,"sourceCode":"        pinotConfig.getExtraHttpHeaders().forEach(requestBuilder::setHeader);\n        Request request = requestBuilder.build();\n\n        long startTime = ticker.read();\n        long duration;\n        StringResponseHandler.StringResponse response;\n        try {\n            response = httpClient.execute(request, createStringResponseHandler());\n        }\n        finally {\n            duration = ticker.read() - startTime;\n        }\n        pinotMetrics.monitorRequest(request, response, duration, TimeUnit.NANOSECONDS);\n        String responseBody = response.getBody();\n        if (PinotUtils.isValidPinotHttpResponseCode(response.getStatusCode())) {\n            return responseBody;\n        }\n        else {\n            throw new PinotException(\n                    PINOT_HTTP_ERROR,\n                    Optional.empty(),\n                    String.format(\n                            \"Unexpected response status: %d for request %s to url %s, with headers %s, full response %s\",\n                            response.getStatusCode(),\n                            requestBody.orElse(\"\"),\n                            request.getUri(),\n                            request.getHeaders(),\n                            responseBody));\n        }\n    }\n\n    private String sendHttpGetToController(String path)\n    {\n        final URI controllerPathUri = HttpUriBuilder\n                .uriBuilder()\n                .scheme(pinotConfig.isUseSecureConnection() ? HTTPS_SCHEME : HTTP_SCHEME)\n                .hostAndPort(HostAndPort.fromString(pinotConfig.getControllerUrl()))","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotClusterInfoFetcher.java#L175-L211","documentation":"Thrown when an HTTP request to a Pinot controller or broker returns a status code not in Pinot's valid response code set. The full request URL, headers, body, and response body are included to make diagnosing the HTTP failure straightforward.","triggerScenarios":"doHttpActionWithHeaders receives a Response whose getStatusCode() fails PinotUtils.isValidPinotHttpResponseCode(); any call to sendHttpGetToController or sendHttpGetToBroker that gets 4xx/5xx (or other unexpected) statuses from the Pinot endpoint.","commonSituations":"Controller/broker down or unreachable behind load balancer (502/503), wrong host/port in connector config (404), auth failures (401/403) on secured Pinot clusters, request timeouts (504).","solutions":["Read the status code and full response body in the message: 404 means wrong URL/path, 401/403 auth, 5xx Pinot-side failure","Verify the Pinot controller/broker URLs in the connector properties (pinot.controller.url etc.) are correct and reachable","Check Pinot controller/broker health and logs at the time of the request","If 401/403, configure authentication credentials for the connector; if 5xx, check Pinot cluster capacity and restart failing instances"],"exampleFix":"// before: stale controller URL\npinot.controller.url=http://old-controller:8098\n// after: correct reachable controller\npinot.controller.url=http://pinot-controller:9000","handlingStrategy":"retry","validationCode":"// Check endpoint reachability before queries\n// curl -s -o /dev/null -w \"%{http_code}\" http://<controller>:9000/health  -> expect 200","typeGuard":null,"tryCatchPattern":"try {\n    connector.query(sql);\n} catch (PinotException e) {\n    if (e.getErrorCode() == PinotErrorCode.PINOT_HTTP_ERROR) {\n        // inspect status in message: retry on 5xx with backoff;\n        // fix config/credentials on 401/403/404\n    }\n    throw e;\n}","preventionTips":["Validate controller/broker URLs in connector properties with a health check","Configure authentication correctly for secured Pinot clusters","Monitor Pinot instance health and alert on 5xx spikes"],"tags":["pinot","http","network","controller","broker"],"backgroundTag":"unexpected-http-status","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"}