{"record":{"id":"b056e163e7436c73","repo":"prestodb/presto","slug":"error-fetching-b056e1","errorCode":null,"errorMessage":"Error fetching ","messagePattern":"Error fetching ","errorType":"exception","errorClass":"PageTransportErrorException","httpStatus":null,"severity":"error","filePath":"presto-spark-base/src/main/java/com/facebook/presto/spark/execution/http/PrestoSparkHttpTaskClient.java","lineNumber":791,"sourceCode":"                String taskInstanceId = getTaskInstanceId(request, response);\n                long token = getToken(request, response);\n                long nextToken = getNextToken(request, response);\n                boolean complete = getComplete(request, response);\n\n                ResponseBody responseBody = response.body();\n                if (responseBody == null) {\n                    throw new PageTransportErrorException(\n                            HostAddress.fromUri(request.url().uri()),\n                            \"Response body is null\");\n                }\n\n                SliceInput input = new InputStreamSliceInput(responseBody.byteStream());\n                List<SerializedPage> pages = ImmutableList.copyOf(readSerializedPages(input));\n                PagesResponse pagesResponse = createPagesResponse(taskInstanceId, token, nextToken, pages, complete);\n                return new PagesBaseResponse(response.code(), convertHeaders(response), pagesResponse);\n            }\n            catch (PageTransportErrorException e) {\n                throw new PageTransportErrorException(\n                        e.getRemoteHost(),\n                        \"Error fetching \" + request.url(),\n                        e);\n            }\n        }\n\n        private static ListMultimap<OkHttpHeaderName, String> convertHeaders(Response response)\n        {\n            ImmutableListMultimap.Builder<OkHttpHeaderName, String> builder = ImmutableListMultimap.builder();\n            for (String name : response.headers().names()) {\n                for (String value : response.headers().values(name)) {\n                    builder.put(OkHttpHeaderName.of(name), value);\n                }\n            }\n            return builder.build();\n        }\n\n        private static String getTaskInstanceId(Request request, Response response)","sourceCodeStart":773,"sourceCodeEnd":809,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spark-base/src/main/java/com/facebook/presto/spark/execution/http/PrestoSparkHttpTaskClient.java#L773-L809","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// probe the worker endpoint before heavy page fetches\nHttpResponse resp = httpClient.head(workerUrl);\nif (resp.code() != 200) throw new IOException(\"Worker unhealthy: \" + workerUrl);","typeGuard":null,"tryCatchPattern":"try {\n    client.getPagesRequest(...);\n} catch (PageTransportErrorException e) {\n    Throwable root = e;\n    while (root.getCause() != null) root = root.getCause();\n    log.error(\"Page fetch failed for %s, root cause: %s\", e.getRemoteHost(), root.getMessage());\n    throw e; // or retry transient causes (IOException, timeouts)\n}","preventionTips":["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."],"tags":["http","spark","page-transport","wrapped-error"],"backgroundTag":"page-transport-error","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"}