{"record":{"id":"3f474d28ce0daf32","repo":"prestodb/presto","slug":"native-execution-binary-not-exist","errorCode":"NATIVE_EXECUTION_BINARY_NOT_EXIST","errorMessage":"File doesn't exist %s","messagePattern":"File doesn't exist (.+?)","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":349,"sourceCode":"     */\n    protected abstract void populateConfigurationFiles(Path configBasePath)\n            throws IOException;\n\n    /**\n     * Resolves a path used for binary or config-dir lookup. Default implementation\n     * treats the path as an absolute filesystem path and verifies the file exists.\n     * Subclasses may override (e.g. to resolve relative paths against\n     * {@code SparkFiles.getRootDirectory()}).\n     */\n    protected String resolveProcessWorkingPath(String path)\n    {\n        File absolutePath = new File(path);\n        if (!absolutePath.isAbsolute()) {\n            absolutePath = new File(\".\", path);\n        }\n        if (!absolutePath.exists()) {\n            log.error(format(\"File doesn't exist %s\", absolutePath.getAbsolutePath()));\n            throw new PrestoException(NATIVE_EXECUTION_BINARY_NOT_EXIST, format(\"File doesn't exist %s\", absolutePath.getAbsolutePath()));\n        }\n        return absolutePath.getAbsolutePath();\n    }\n\n    @VisibleForTesting\n    public SettableFuture<ServerInfo> getServerInfoWithRetry()\n    {\n        SettableFuture<ServerInfo> future = SettableFuture.create();\n        doGetServerInfo(future);\n        return future;\n    }\n\n    /**\n     * Triggers coredump (also terminates the process).\n     */\n    public void terminateWithCore(Duration timeout)\n    {\n        // chosen as the least likely core signal to occur naturally (invalid sys call)","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spark-base/src/main/java/com/facebook/presto/spark/execution/nativeprocess/AbstractNativeProcess.java#L331-L367","documentation":"Thrown by AbstractNativeProcess.resolveProcessWorkingPath (used via configPathStr) when a required native-execution configuration file path does not exist on the local filesystem. The method resolves relative paths against the current directory and fails fast with NATIVE_EXECUTION_BINARY_NOT_EXIST so the native process is never launched with a missing file.","triggerScenarios":"Calling configPathStr()/resolveProcessWorkingPath() with a path string whose resolved absolute File.exists() is false — e.g. passing a bad config path or binary path when constructing the native process arguments.","commonSituations":"Typo in the config file path; file present on the coordinator but not on the Spark executor/driver host; container image missing the config; relative path with a different working directory than expected; path not mounted in Kubernetes/Docker.","solutions":["Verify the path exists on the exact host that launches the native process (Spark executor/driver), not just the client machine","Use absolute paths in configuration instead of relying on the current working directory","If packaging in a container, confirm the config file is copied/mounted into the image at the configured path","Check permissions so the process user can stat/read the file (a permission issue can look like a missing file in some setups)","Correct the config property (e.g. native.process.max-error-duration file paths in Spark conf) to point at the deployed location"],"exampleFix":"// before\nString config = \"conf/native/velox.properties\"; // relative, wrong CWD\nString resolved = process.configPathStr(config);\n// after\nString config = \"/opt/presto/conf/native/velox.properties\"; // absolute path\nif (!new File(config).exists()) {\n    throw new IllegalStateException(\"Native config missing before launch: \" + config);\n}\nString resolved = process.configPathStr(config);","handlingStrategy":"validation","validationCode":"public static void requireNativeFiles(String... paths) {\n    for (String p : paths) {\n        File f = new File(p);\n        File abs = f.isAbsolute() ? f : new File(\".\", p);\n        if (!abs.exists()) {\n            throw new IllegalStateException(\"Required native file missing: \" + abs.getAbsolutePath());\n        }\n    }\n}\n// call before constructing the process:\nrequireNativeFiles(nativeBinaryPath, veloxConfigPath, catalogConfigPath);","typeGuard":null,"tryCatchPattern":"try {\n    String resolved = process.configPathStr(path);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"NATIVE_EXECUTION_BINARY_NOT_EXIST\")) {\n        log.error(\"Missing native file, cwd=%s path=%s\", new File(\".\").getAbsolutePath(), path);\n        // fix config or fail fast before launch\n    }\n}","preventionTips":["Always configure absolute paths for native binaries and config files","Validate all configured paths exist on the launching host (executor/driver) at startup","Bake native configs into container images and verify with a startup check","Log the process working directory alongside the error to catch CWD-relative path mistakes"],"tags":["native-execution","presto-spark","missing-file","configuration"],"backgroundTag":"file-not-found","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"}