{"record":{"id":"891f65a585ddb569","repo":"prestodb/presto","slug":"generic-internal-error-891f65","errorCode":"GENERIC_INTERNAL_ERROR","errorMessage":"Request failed with HTTP status ","messagePattern":"Request failed with HTTP status ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-spark-base/src/main/java/com/facebook/presto/spark/execution/nativeprocess/AbstractNativeProcess.java","lineNumber":529,"sourceCode":"            int p = socket.getLocalPort();\n            socket.close();\n            return p;\n        }\n        catch (Exception ex) {\n            // Something is wrong with the executor — fail it.\n            throw new PrestoSparkFatalException(\"Failed to acquire port on host\", ex);\n        }\n    }\n\n    private void doGetServerInfo(SettableFuture<ServerInfo> future)\n    {\n        addCallback(serverClient.getServerInfo(), new FutureCallback<BaseResponse<ServerInfo>>()\n        {\n            @Override\n            public void onSuccess(@Nullable BaseResponse<ServerInfo> response)\n            {\n                if (response.getStatusCode() != SC_OK) {\n                    throw new PrestoException(GENERIC_INTERNAL_ERROR, \"Request failed with HTTP status \" + response.getStatusCode());\n                }\n                future.set(response.getValue());\n            }\n\n            @Override\n            public void onFailure(Throwable failedReason)\n            {\n                if (failedReason instanceof RejectedExecutionException) {\n                    log.error(format(\"Unable to start the native process. Reason: %s\", failedReason.getMessage()));\n                    future.setException(failedReason);\n                    return;\n                }\n                // record failure\n                try {\n                    errorTracker.requestFailed(failedReason);\n                }\n                catch (PrestoException e) {\n                    future.setException(e);","sourceCodeStart":511,"sourceCodeEnd":547,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spark-base/src/main/java/com/facebook/presto/spark/execution/nativeprocess/AbstractNativeProcess.java#L511-L547","documentation":"In AbstractNativeProcess.doGetServerInfo, the async callback for the native process's /v1/info (server info) HTTP call throws PrestoException(GENERIC_INTERNAL_ERROR) when the native worker responds with any HTTP status other than 200 OK. This means the process started but its server-info endpoint rejected the request, so the process startup handshake fails.","triggerScenarios":"serverClient.getServerInfo() completes successfully but response.getStatusCode() != 200 — the native worker returned 404, 500, 503, etc. for the server-info request during process startup.","commonSituations":"Native worker binary version mismatch between coordinator client and worker HTTP endpoints; worker up but overloaded/initializing and returning 503; wrong port assigned to a process (another service answering); native worker crash mid-handshake returning an error page.","solutions":["Check the native worker log/stderr (getCrashReport/abortMessage) for why the server-info endpoint returned a non-200 status.","Verify native worker and coordinator versions are compatible (endpoint paths unchanged).","Confirm the acquired port is actually used by the native process and not occupied by another service.","If 503 during startup, increase startup timeout/retry window so the worker has time to become ready."],"exampleFix":"// before: any non-200 is immediately fatal\nif (response.getStatusCode() != SC_OK) {\n    throw new PrestoException(GENERIC_INTERNAL_ERROR, \"Request failed with HTTP status \" + response.getStatusCode());\n}\n// after (caller-side): retry startup probe before giving up\nif (response.getStatusCode() != SC_OK) {\n    if (errorTracker.requestFailed(\n            new PrestoException(GENERIC_INTERNAL_ERROR, \"HTTP \" + response.getStatusCode())) == null) {\n        return; // retried within window\n    }\n    throw new PrestoException(GENERIC_INTERNAL_ERROR, \"Request failed with HTTP status \" + response.getStatusCode());\n}","handlingStrategy":"try-catch","validationCode":"// pre-flight: probe the native worker's server-info endpoint after startup\ntry (Response r = httpClient.newCall(new Request.Builder()\n        .url(\"http://\" + host + \":\" + port + \"/v1/info\").build()).execute()) {\n    if (r.code() != 200) {\n        throw new IllegalStateException(\"Native worker /v1/info returned HTTP \" + r.code());\n    }\n}","typeGuard":"public static boolean isOk(BaseResponse<?> response) {\n    return response != null && response.getStatusCode() == 200;\n}","tryCatchPattern":"try {\n    ServerInfo info = process.waitForServerInfo().get(2, TimeUnit.MINUTES);\n} catch (ExecutionException e) {\n    if (e.getCause() instanceof PrestoException\n            && e.getCause().getMessage().startsWith(\"Request failed with HTTP status\")) {\n        // inspect native worker logs / crash report, then retry on another node\n        log.error(\"Native startup handshake failed: %s\", process.getCrashReport());\n    }\n    throw e;\n}","preventionTips":["Keep native worker binaries and coordinator in version lockstep so endpoint contracts match.","Monitor native worker startup logs for non-200 responses on /v1/info.","Reserve the acquired port before launching the worker to avoid port collisions with other services.","Allow generous startup timeouts so workers returning 503 during init can recover."],"tags":["http","native-execution","presto-spark","startup"],"backgroundTag":"http-non-200-response","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"}