{"record":{"id":"3fb9978f71c3611e","repo":"prestodb/presto","slug":"expected-s-response-from-server-but-got-s","errorCode":null,"errorMessage":"Expected %s response from server but got %s","messagePattern":"Expected (.+?) response from server but got (.+?)","errorType":"exception","errorClass":"PageTransportErrorException","httpStatus":null,"severity":"error","filePath":"presto-main/src/main/java/com/facebook/presto/operator/HttpRpcShuffleClient.java","lineNumber":180,"sourceCode":"                    catch (RuntimeException | IOException e) {\n                        // Ignored. Just return whatever message we were able to decode\n                    }\n                    throw new PageTransportErrorException(\n                            HostAddress.fromUri(request.getUri()),\n                            format(\"Expected response code to be 200, but was %s:%n%s\",\n                                    response.getStatusCode(),\n                                    body.toString()));\n                }\n\n                // invalid content type can happen when an error page is returned, but is unlikely given the above 200\n                String contentType = response.getHeader(CONTENT_TYPE);\n                if (contentType == null) {\n                    throw new PageTransportErrorException(\n                            HostAddress.fromUri(request.getUri()),\n                            format(\"%s header is not set: %s\", CONTENT_TYPE, response));\n                }\n                if (!mediaTypeMatches(contentType, PRESTO_PAGES_TYPE)) {\n                    throw new PageTransportErrorException(\n                            HostAddress.fromUri(request.getUri()),\n                            format(\"Expected %s response from server but got %s\", PRESTO_PAGES_TYPE, contentType));\n                }\n\n                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                try (SliceInput input = new InputStreamSliceInput(response.getInputStream())) {\n                    List<SerializedPage> pages = ImmutableList.copyOf(readSerializedPages(input));\n                    return createPagesResponse(taskInstanceId, token, nextToken, pages, complete);\n                }\n                catch (IOException e) {\n                    throw new RuntimeException(e);\n                }\n            }\n            catch (PageTransportErrorException e) {","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main/src/main/java/com/facebook/presto/operator/HttpRpcShuffleClient.java#L162-L198","documentation":"The shuffle response's Content-Type did not match the expected application/x-presto-pages type. This typically happens when the worker returned an error page (HTML/text) instead of pages; the expected type and actual content type are reported.","triggerScenarios":"Thrown at presto-main/src/main/java/com/facebook/presto/operator/HttpRpcShuffleClient.java:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check worker logs for the underlying failure that produced the non-page response","Verify no proxy or load balancer is rewriting responses between workers"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}