{"record":{"id":"948ea7275abf9573","repo":"prestodb/presto","slug":"could-not-create-spill-path-s-adjust-experimenta-948ea7","errorCode":null,"errorMessage":"could not create spill path %s; adjust experimental.spiller-spill-path config property or filesystem permissions","messagePattern":"could not create spill path (.+?); adjust experimental\\.spiller-spill-path config property or filesystem permissions","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"presto-main-base/src/main/java/com/facebook/presto/spiller/LocalTempStorage.java","lineNumber":89,"sourceCode":"    @GuardedBy(\"this\")\n    private int roundRobinIndex;\n\n    public LocalTempStorage(List<Path> spillPaths, double maxUsedSpaceThreshold)\n    {\n        this.spillPaths = ImmutableList.copyOf(requireNonNull(spillPaths, \"spillPaths is null\"));\n        this.maxUsedSpaceThreshold = maxUsedSpaceThreshold;\n        initialize();\n    }\n\n    private void initialize()\n    {\n        // From FileSingleStreamSpillerFactory constructor\n        spillPaths.forEach(path -> {\n            try {\n                createDirectories(path);\n            }\n            catch (IOException e) {\n                throw new IllegalArgumentException(\n                        format(\"could not create spill path %s; adjust experimental.spiller-spill-path config property or filesystem permissions\", path), e);\n            }\n            if (!path.toFile().canWrite()) {\n                throw new IllegalArgumentException(\n                        format(\"spill path %s is not writable; adjust experimental.spiller-spill-path config property or filesystem permissions\", path));\n            }\n        });\n\n        // From FileSingleStreamSpillerFactory#cleanupOldSpillFiles\n        spillPaths.forEach(LocalTempStorage::cleanupOldSpillFiles);\n    }\n\n    @Override\n    public TempDataSink create(TempDataOperationContext context)\n            throws IOException\n    {\n        Path path = Files.createTempFile(getNextSpillPath(), SPILL_FILE_PREFIX, SPILL_FILE_SUFFIX);\n        return new LocalTempDataSink(path);","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/spiller/LocalTempStorage.java#L71-L107","documentation":"LocalTempStorage.initialize() mirrors FileSingleStreamSpillerFactory's constructor validation: for every configured spill path it attempts Files.createDirectories(). On IOException it throws IllegalArgumentException 'could not create spill path %s; adjust experimental.spiller-spill-path config property or filesystem permissions'. Storage initialization aborts when a spill directory cannot be created.","triggerScenarios":"Constructing LocalTempStorage when Files.createDirectories(path) throws IOException — path's parent is not writable, path exists as a regular file, or a transient I/O error prevents directory creation.","commonSituations":"Spill path collides with an existing file; parent directory owned by another user; mis-typed path like /var/spil (creating under non-writable /var); immutable container root filesystem; SELinux/AppArmor denying creation.","solutions":["Pre-create the directory with correct ownership: mkdir -p <spill-path> && chown presto:presto <spill-path>.","Ensure the configured value is a directory path, not an existing file; remove/rename any conflicting file.","Fix parent-directory permissions so the Presto user can create the leaf directory.","Check SELinux/Deny rules (audit logs) and apply correct contexts or adjust policy."],"exampleFix":"// before (config.properties)\nexperimental.spiller-spill-path=/nonexistent-parent/spill\n\n// after (shell)\n// mkdir -p /var/spill && chown presto:presto /var/spill\nexperimental.spiller-spill-path=/var/spill","handlingStrategy":"validation","validationCode":"for (Path p : spillPaths) {\n    if (p.toFile().exists() && !p.toFile().isDirectory()) {\n        throw new IllegalStateException(\"Spill path exists but is not a directory: \" + p);\n    }\n    java.io.File parent = p.toFile().getParentFile();\n    if (parent == null || !parent.canWrite()) {\n        throw new IllegalStateException(\"Cannot create spill path, parent not writable: \" + p);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-create spill directories in provisioning before Presto starts","Avoid pointing spill paths at existing files or non-writable parents","Check SELinux/AppArmor policies for the service user"],"tags":["spill","filesystem","permissions","configuration","presto"],"backgroundTag":"spill-path-not-writable","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"}