{"record":{"id":"c1203fb5a5a5b31e","repo":"prestodb/presto","slug":"native-execution-process-launch-error-c1203f","errorCode":"NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR","errorMessage":"Cannot start native process: %s","messagePattern":"Cannot start native process: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-spark-base/src/main/java/com/facebook/presto/spark/execution/nativeprocess/DetachedNativeExecutionProcessFactory.java","lineNumber":89,"sourceCode":"\n    @Override\n    public NativeExecutionProcess createNativeExecutionProcess(Session session,\n            Duration maxErrorDuration, Optional<TempStorageHandle> nativeTempStorageHandle)\n    {\n        try {\n            return new DetachedNativeExecutionProcess(\n                    getExecutablePath(),\n                    getProgramArguments(),\n                    session,\n                    httpClient,\n                    coreExecutor,\n                    errorRetryScheduledExecutor,\n                    serverInfoCodec,\n                    maxErrorDuration,\n                    workerProperty);\n        }\n        catch (IOException e) {\n            throw new PrestoException(NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR, format(\"Cannot start native process: %s\", e.getMessage()), e);\n        }\n    }\n}\n","sourceCodeStart":71,"sourceCodeEnd":93,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spark-base/src/main/java/com/facebook/presto/spark/execution/nativeprocess/DetachedNativeExecutionProcessFactory.java#L71-L93","documentation":"DetachedNativeExecutionProcessFactory.createNativeExecutionProcess constructs a DetachedNativeExecutionProcess, which spawns the native worker executable via ProcessBuilder-like APIs. If the OS-level launch throws IOException (executable missing, not executable, argument/redirect problems), it is converted to PrestoException with code NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR.","triggerScenarios":"Calling getNativeExecutionProcess/createNativeExecutionProcess when new DetachedNativeExecutionProcess(...) throws IOException during process spawn — executable not found, no execute permission, or I/O error creating the native process.","commonSituations":"Wrong native-execution executable path configuration; native binary not deployed to Spark executor nodes; binary lacks +x permission or wrong architecture (arm64 vs x86_64); missing shared libraries causing exec to fail; read-only container filesystem.","solutions":["Verify the native executable path configured for native execution exists on every executor node.","Check permissions: chmod +x on the binary, and confirm it matches the node architecture/OS.","Run ldd on the binary on an executor node to confirm all shared libraries resolve.","Check node logs for the wrapped IOException cause; fix the underlying exec failure it reports."],"exampleFix":"// before: launch fails because binary missing on executor\nnew ProcessBuilder(\"/opt/presto-native/not-installed/velox_exec\")...\n// after: validate before launching\nPath bin = Paths.get(executablePath);\nif (!Files.isExecutable(bin)) {\n    throw new PrestoException(NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR,\n            \"Native executable missing or not executable: \" + executablePath);\n}","handlingStrategy":"validation","validationCode":"import java.nio.file.*;\n\npublic static void validateNativeExecutable(String path) {\n    Path bin = Paths.get(path);\n    if (!Files.isRegularFile(bin)) {\n        throw new IllegalStateException(\"Native executable not found: \" + path);\n    }\n    if (!Files.isExecutable(bin)) {\n        throw new IllegalStateException(\"Native executable is not executable: \" + path);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    NativeExecutionProcess p = factory.getNativeExecutionProcess(session, tempStorageHandle);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR\")) {\n        // check cause IOException: missing binary, permission, or arch mismatch\n        log.error(\"Native launch failed: %s\", e.getCause());\n    }\n    throw e;\n}","preventionTips":["Deploy and verify the native executable on every executor node as part of image build.","Set executable permissions and validate architecture (uname -m) against the binary in CI.","Run ldd/otool checks on the binary to catch missing shared libraries before deployment.","Catch NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR and surface the wrapped IOException cause in alerts."],"tags":["process-launch","native-execution","presto-spark","io"],"backgroundTag":"process-launch-failure","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"}