{"record":{"id":"2a789caa0d06965e","repo":"prestodb/presto","slug":"rest-server-not-found","errorCode":"REST_SERVER_NOT_FOUND","errorMessage":"Resource not found on REST server. Request: ","messagePattern":"Resource not found on REST server\\. Request: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":404,"severity":"error","filePath":"presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestSqlFunctionExecutor.java","lineNumber":180,"sourceCode":"        @Override\n        public SqlFunctionResult handleException(Request request, Exception exception)\n        {\n            if (exception instanceof java.net.SocketTimeoutException) {\n                throw new PrestoException(REST_SERVER_TIMEOUT, \"Request to REST server timed out. Request: \" + request, exception);\n            }\n            else if (exception instanceof java.net.ConnectException) {\n                throw new PrestoException(REST_SERVER_CONNECT_ERROR, \"Failed to connect to REST server. Request: \" + request, exception);\n            }\n            else {\n                throw new PrestoException(REST_SERVER_ERROR, \"Unexpected error during REST call. Request: \" + request + \", Exception: \" + exception.getMessage(), exception);\n            }\n        }\n\n        @Override\n        public SqlFunctionResult handle(Request request, Response response)\n        {\n            if (response.getStatusCode() == HTTP_NOT_FOUND) {\n                throw new PrestoException(REST_SERVER_NOT_FOUND, \"Resource not found on REST server. Request: \" + request);\n            }\n            else if (response.getStatusCode() == HTTP_SERVER_ERROR) {\n                throw new PrestoException(REST_SERVER_ERROR, \"Internal server error on REST server. Request: \" + request);\n            }\n            else if (response.getStatusCode() != HTTP_OK) {\n                throw new PrestoException(REST_SERVER_BAD_RESPONSE, \"Unexpected response code: \" + response.getStatusCode() + \". Request: \" + request);\n            }\n\n            try {\n                SliceInput input = new InputStreamSliceInput(response.getInputStream());\n                SerializedPage serializedPage = readSerializedPage(input);\n                Page page = pageSerde.deserialize(serializedPage);\n                checkArgument(page.getChannelCount() == 1, \"Expected only one channel in the function output\");\n                SqlFunctionResult output = new SqlFunctionResult(page.getBlock(0), 1);\n                return output;\n            }\n            catch (IOException e) {\n                throw new PrestoException(REST_SERVER_IO_ERROR, \"Error deserializing REST server response: \" + e.getMessage(), e);","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestSqlFunctionExecutor.java#L162-L198","documentation":"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.","triggerScenarios":"Thrown at presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestSqlFunctionExecutor.java:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"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"}