{"record":{"id":"24cde8ea543361ae","repo":"prestodb/presto","slug":"file-doesn-t-exist-s","errorCode":null,"errorMessage":"File doesn't exist %s","messagePattern":"File doesn't exist (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-spark-base/src/main/java/com/facebook/presto/spark/execution/property/NativeExecutionSystemConfig.java","lineNumber":222,"sourceCode":"    }\n\n    public NativeExecutionSystemConfig update(String key, String value)\n    {\n        systemConfigs.put(key, value);\n        return this;\n    }\n\n    private String getAbsolutePath(String path)\n    {\n        File absolutePath = new File(path);\n        if (!absolutePath.isAbsolute()) {\n            // In the case of SparkEnv is not initialed (e.g. unit test), we just use current location instead of calling SparkFiles.getRootDirectory() to avoid error.\n            String rootDirectory = SparkEnv$.MODULE$.get() != null ? SparkFiles.getRootDirectory() : \".\";\n            absolutePath = new File(rootDirectory, path);\n        }\n\n        if (!absolutePath.exists()) {\n            throw new IllegalArgumentException(format(\"File doesn't exist %s\", absolutePath.getAbsolutePath()));\n        }\n\n        return absolutePath.getAbsolutePath();\n    }\n}\n","sourceCodeStart":204,"sourceCodeEnd":228,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spark-base/src/main/java/com/facebook/presto/spark/execution/property/NativeExecutionSystemConfig.java#L204-L228","documentation":"NativeExecutionSystemConfig.getAbsolutePath() resolves configured native execution paths (binaries, configs). Relative paths are resolved against SparkFiles.getRootDirectory() when SparkEnv is initialized, or the current directory otherwise. If the resolved file does not exist, it throws IllegalArgumentException 'File doesn't exist %s' during configuration validation.","triggerScenarios":"getAbsolutePath (called from NativeExecutionSystemConfig getters during config binding/initialization) resolves a configured path and File.exists() is false — thrown at NativeExecutionSystemConfig.java:222 when the config is first accessed.","commonSituations":"Config points at a file that exists on the submitting machine but not on executors/drivers, relative path with no Spark files distributed (falls back to '.'), unit-test environments where SparkEnv is null and cwd lacks the file, or typos in config values.","solutions":["Verify the absolute path from the error exists on the machine where this code runs","Ship required files via spark.files/spark.archives so they land in SparkFiles.getRootDirectory()","Use an absolute path in the configuration if you don't rely on Spark file distribution","In tests, point the config at files relative to the test working directory since SparkEnv is null"],"exampleFix":"// before\nnative-execution-system.config=worker_config.json  # resolved against '.', missing\n// after\nspark.files=/opt/presto/etc/worker_config.json\nnative-execution-system.config=worker_config.json","handlingStrategy":"validation","validationCode":"String root = SparkEnv$.MODULE$.get() != null ? SparkFiles.getRootDirectory() : \".\";\nFile f = path.isAbsolute() ? new File(path) : new File(root, path);\nif (!f.exists()) throw new IllegalStateException(\"Config file missing before init: \" + f.getAbsolutePath());","typeGuard":null,"tryCatchPattern":"try {\n    nativeExecutionSystemConfig.getAbsolutePath(configuredPath);\n} catch (IllegalArgumentException e) {\n    // file missing at resolved location; fix config or distribute file\n}","preventionTips":["Distribute all configured files via spark.files before executors start","Prefer absolute paths when not relying on Spark file distribution","In unit tests, place config files in the test working directory (SparkEnv is null)"],"tags":["file-not-found","configuration","spark","native-execution"],"backgroundTag":"native-binary-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"}