prestodb/presto · error · PinotException
PINOT_HTTP_ERROR
PINOT_HTTP_ERROR
Error message
Unexpected response status: %d for request %s to url %s, with headers %s, full response %s
What it means
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.
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
Example fix
// before: stale controller URL pinot.controller.url=http://old-controller:8098 // after: correct reachable controller pinot.controller.url=http://pinot-controller:9000
Defensive patterns
Strategy: retry
Validate before calling
// Check endpoint reachability before queries
// curl -s -o /dev/null -w "%{http_code}" http://<controller>:9000/health -> expect 200 Try / catch
try {
connector.query(sql);
} catch (PinotException e) {
if (e.getErrorCode() == PinotErrorCode.PINOT_HTTP_ERROR) {
// inspect status in message: retry on 5xx with backoff;
// fix config/credentials on 401/403/404
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- ${e.getMessage()}
- Error fetching next (attempts: , duration: )
- Error reading response from server
- Expected response code to be 200, but was
- Failed reading response from remote Presto server
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/2267d8148cace944.
Report an issue: GitHub.
Appendix: source
Thrown at presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotClusterInfoFetcher.java:193
pinotConfig.getExtraHttpHeaders().forEach(requestBuilder::setHeader);
Request request = requestBuilder.build();
long startTime = ticker.read();
long duration;
StringResponseHandler.StringResponse response;
try {
response = httpClient.execute(request, createStringResponseHandler());
}
finally {
duration = ticker.read() - startTime;
}
pinotMetrics.monitorRequest(request, response, duration, TimeUnit.NANOSECONDS);
String responseBody = response.getBody();
if (PinotUtils.isValidPinotHttpResponseCode(response.getStatusCode())) {
return responseBody;
}
else {
throw new PinotException(
PINOT_HTTP_ERROR,
Optional.empty(),
String.format(
"Unexpected response status: %d for request %s to url %s, with headers %s, full response %s",
response.getStatusCode(),
requestBody.orElse(""),
request.getUri(),
request.getHeaders(),
responseBody));
}
}
private String sendHttpGetToController(String path)
{
final URI controllerPathUri = HttpUriBuilder
.uriBuilder()
.scheme(pinotConfig.isUseSecureConnection() ? HTTPS_SCHEME : HTTP_SCHEME)
.hostAndPort(HostAndPort.fromString(pinotConfig.getControllerUrl()))View on GitHub (pinned to 55bb57d202)