prestodb/presto · error · PageTransportErrorException
Error fetching
Error message
Error fetching
What it means
This is a wrapper error: after any failure inside the pages-response parsing block (bad headers, null body, corrupt smile stream), the client re-throws it as PageTransportErrorException with message 'Error fetching <request url>' and the original error as the cause, so all page-download failures surface uniformly with the failing URL and remote host.
Source
Thrown at presto-spark-base/src/main/java/com/facebook/presto/spark/execution/http/PrestoSparkHttpTaskClient.java:791
String taskInstanceId = getTaskInstanceId(request, response);
long token = getToken(request, response);
long nextToken = getNextToken(request, response);
boolean complete = getComplete(request, response);
ResponseBody responseBody = response.body();
if (responseBody == null) {
throw new PageTransportErrorException(
HostAddress.fromUri(request.url().uri()),
"Response body is null");
}
SliceInput input = new InputStreamSliceInput(responseBody.byteStream());
List<SerializedPage> pages = ImmutableList.copyOf(readSerializedPages(input));
PagesResponse pagesResponse = createPagesResponse(taskInstanceId, token, nextToken, pages, complete);
return new PagesBaseResponse(response.code(), convertHeaders(response), pagesResponse);
}
catch (PageTransportErrorException e) {
throw new PageTransportErrorException(
e.getRemoteHost(),
"Error fetching " + request.url(),
e);
}
}
private static ListMultimap<OkHttpHeaderName, String> convertHeaders(Response response)
{
ImmutableListMultimap.Builder<OkHttpHeaderName, String> builder = ImmutableListMultimap.builder();
for (String name : response.headers().names()) {
for (String value : response.headers().values(name)) {
builder.put(OkHttpHeaderName.of(name), value);
}
}
return builder.build();
}
private static String getTaskInstanceId(Request request, Response response)View on GitHub (pinned to 55bb57d202)
Solutions
- Look at the cause chain of this exception — the root cause message names the actual validation that failed.
- Re-run the query; page transport errors are often transient after worker restarts.
- Check the remote host in the exception and inspect that worker's logs for serialization/streaming faults.
- Verify client/server Presto versions use the same serialized-page format.
- If persistent, restart or replace the implicated worker and retry the query.
Defensive patterns
Strategy: try-catch
Validate before calling
// probe the worker endpoint before heavy page fetches
HttpResponse resp = httpClient.head(workerUrl);
if (resp.code() != 200) throw new IOException("Worker unhealthy: " + workerUrl); Try / catch
try {
client.getPagesRequest(...);
} catch (PageTransportErrorException e) {
Throwable root = e;
while (root.getCause() != null) root = root.getCause();
log.error("Page fetch failed for %s, root cause: %s", e.getRemoteHost(), root.getMessage());
throw e; // or retry transient causes (IOException, timeouts)
} Prevention
- Always inspect the cause chain; the outer message only names the URL.
- Match Presto versions across client and workers.
- Set sane read timeouts so stuck streams surface as retryable errors.
- Monitor worker memory/health — OOM workers send truncated pages.
When it happens
Trigger: Any exception raised while processing a successful-status pages response: PageTransportErrorException from header/content-type/body validation, or an IOException while decoding serialized pages from the response stream.
Common situations: Worker returned malformed pages data (version mismatch in serialization format); network interruption mid-stream; any of errors 3750–3756 being wrapped; OOM in the worker returning truncated data.
Related errors
- Expected response code to be 200, but was %s:%n%s
- %s header is not set: %s
- Response body is null
- shuffleWriteInfo and broadcastBasePath can not be specified
- Error reading response from server
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/b056e163e7436c73.
Report an issue: GitHub.