prestodb/presto · error · PrestoException

REST_SERVER_IO_ERROR

REST_SERVER_IO_ERROR

Error message

Error deserializing REST server response: 

What it means

After a 200 response, the JSON body of the function-execution reply could not be deserialized into SqlFunctionResult — the REST server returned malformed or unexpected JSON, raising this REST_SERVER_BAD_RESPONSE error.

Source

Thrown at presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestSqlFunctionExecutor.java:198

                throw new PrestoException(REST_SERVER_NOT_FOUND, "Resource not found on REST server. Request: " + request);
            }
            else if (response.getStatusCode() == HTTP_SERVER_ERROR) {
                throw new PrestoException(REST_SERVER_ERROR, "Internal server error on REST server. Request: " + request);
            }
            else if (response.getStatusCode() != HTTP_OK) {
                throw new PrestoException(REST_SERVER_BAD_RESPONSE, "Unexpected response code: " + response.getStatusCode() + ". Request: " + request);
            }

            try {
                SliceInput input = new InputStreamSliceInput(response.getInputStream());
                SerializedPage serializedPage = readSerializedPage(input);
                Page page = pageSerde.deserialize(serializedPage);
                checkArgument(page.getChannelCount() == 1, "Expected only one channel in the function output");
                SqlFunctionResult output = new SqlFunctionResult(page.getBlock(0), 1);
                return output;
            }
            catch (IOException e) {
                throw new PrestoException(REST_SERVER_IO_ERROR, "Error deserializing REST server response: " + e.getMessage(), e);
            }
        }
    }

    public static class SqlResultFutureCallback
            implements FutureCallback<SqlFunctionResult>
    {
        @Override
        public void onSuccess(SqlFunctionResult result)
        {
            result.getResult();
        }

        @Override
        public void onFailure(Throwable t)
        {
            if (t instanceof PrestoException) {
                throw (PrestoException) t;

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the REST server response format matches the expected schema
  2. Align client and server versions for the response codec
  3. Inspect the raw response body for proxy/HTML error pages
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestSqlFunctionExecutor.java:198 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/6e7dd9267317f049. Report an issue: GitHub.