prestodb/presto · error · PrestoException
REST_SERVER_NOT_FOUND
REST_SERVER_NOT_FOUND
Error message
Resource not found on REST server. Request:
What it means
Thrown by the REST function-namespace executor's exception handler when the HTTP call for a function lookup completes with an error and the server reports the requested resource as absent (404-class outcome). The failing request is appended so the missing function/endpoint can be identified.
Source
Thrown at presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestSqlFunctionExecutor.java:180
@Override
public SqlFunctionResult handleException(Request request, Exception exception)
{
if (exception instanceof java.net.SocketTimeoutException) {
throw new PrestoException(REST_SERVER_TIMEOUT, "Request to REST server timed out. Request: " + request, exception);
}
else if (exception instanceof java.net.ConnectException) {
throw new PrestoException(REST_SERVER_CONNECT_ERROR, "Failed to connect to REST server. Request: " + request, exception);
}
else {
throw new PrestoException(REST_SERVER_ERROR, "Unexpected error during REST call. Request: " + request + ", Exception: " + exception.getMessage(), exception);
}
}
@Override
public SqlFunctionResult handle(Request request, Response response)
{
if (response.getStatusCode() == HTTP_NOT_FOUND) {
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);View on GitHub (pinned to 55bb57d202)
Solutions
- Verify the function exists in the namespace at that REST endpoint
- Check function name and version in the invocation
- Re-register the missing function
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestSqlFunctionExecutor.java:180 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/2a789caa0d06965e.
Report an issue: GitHub.