{"record":{"id":"9d5dd03563622fe8","repo":"prestodb/presto","slug":"native-execution-process-launch-error-9d5dd0","errorCode":"NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR","errorMessage":"Failed to start metadata sidecar","messagePattern":"Failed to start metadata sidecar","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"critical","filePath":"presto-spark-base/src/main/java/com/facebook/presto/spark/execution/nativeprocess/MetadataSidecarProcessFactory.java","lineNumber":111,"sourceCode":"                serverInfoCodec,\n                config.getStartupTimeout(),\n                config.getStorageOncallName(),\n                config.getStorageUserName(),\n                config.getStorageServiceName());\n        try {\n            process.start();\n        }\n        catch (ExecutionException | InterruptedException | java.io.IOException e) {\n            if (e instanceof InterruptedException) {\n                Thread.currentThread().interrupt();\n            }\n            try {\n                process.close();\n            }\n            catch (Exception suppressed) {\n                e.addSuppressed(suppressed);\n            }\n            throw new PrestoException(\n                    NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR,\n                    \"Failed to start metadata sidecar\",\n                    e);\n        }\n        log.info(\"Metadata sidecar started at %s\", process.getLocation());\n        return process.getLocation();\n    }\n\n    @PreDestroy\n    public synchronized void close()\n    {\n        executor.shutdownNow();\n        scheduledExecutor.shutdownNow();\n        if (process != null) {\n            try {\n                log.info(\"Stopping metadata sidecar at %s\", process.getLocation());\n                process.close();\n            }","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spark-base/src/main/java/com/facebook/presto/spark/execution/nativeprocess/MetadataSidecarProcessFactory.java#L93-L129","documentation":"MetadataSidecarProcessFactory.getOrStart() starts the metadata sidecar process and returns its location. If starting the process throws, it closes the partially started process (adding close failures as suppressed exceptions) and rethrows as PrestoException NATIVE_EXECUTION_PROCESS_LAUNCH_ERROR with the message 'Failed to start metadata sidecar'.","triggerScenarios":"getOrStart() invokes the process factory to launch the sidecar and the underlying start fails (IOException from process creation, launch timeout, readiness failure); after process.close() cleanup, this exception is thrown at MetadataSidecarProcessFactory.java:111.","commonSituations":"Sidecar binary not found in the Spark file distribution (SparkFiles root), binary lacks execute permission, driver temp/working directory is unwritable, port conflicts, or incompatible native binary for the host OS/arch.","solutions":["Check the cause `e` of this exception for the root failure (binary missing, exec denied, timeout)","Ensure the sidecar binary is shipped to Spark workers/drivers and is executable (chmod +x, correct --binary-path config)","Verify the driver's working directory and native temp storage are writable","Check for port conflicts with the sidecar's configured listen port"],"exampleFix":"// before\nnative.binary-path=/wrong/path/presto_native_sidecar\n// after\nnative.binary-path=/opt/presto/native/presto_native_sidecar  # executable and distributed via spark.files","handlingStrategy":"validation","validationCode":"Path binary = Paths.get(config.getSidecarBinaryPath());\nif (!Files.isRegularFile(binary) || !Files.isExecutable(binary)) {\n    throw new IllegalStateException(\"Sidecar binary not executable: \" + binary);\n}","typeGuard":null,"tryCatchPattern":"try {\n    URI location = sidecarProcessFactory.getOrStart();\n} catch (PrestoException e) {\n    // read e + suppressed exceptions; the cause and suppressed close error both matter\n}","preventionTips":["Distribute the sidecar binary via spark.files and chmod +x","Validate binary-path config in a preflight check at job submission","Confirm driver working directory is writable"],"tags":["native-execution","process-launch","sidecar","configuration"],"backgroundTag":"native-process-launch-failed","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"}