{"record":{"id":"78654e502a173342","repo":"prestodb/presto","slug":"spill-path-s-is-not-writable-adjust-experimental-78654e","errorCode":null,"errorMessage":"spill path %s is not writable; adjust experimental.spiller-spill-path config property or filesystem permissions","messagePattern":"spill path (.+?) is not writable; 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":93,"sourceCode":"    {\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);\n    }\n\n    @Override\n    public InputStream open(TempDataOperationContext context, TempStorageHandle handle)","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/spiller/LocalTempStorage.java#L75-L111","documentation":"During LocalTempStorage.initialize(), after creating each spill path it checks path.toFile().canWrite() and throws IllegalArgumentException 'spill path %s is not writable...' if the check fails. Initialization fails fast when the Presto process lacks write permission on a configured spill directory.","triggerScenarios":"Constructing LocalTempStorage when a successfully created/existing spill directory returns canWrite()==false — directory owned by another user, read-only mode bits, or read-only mount for the process user.","commonSituations":"Presto running as non-root user while spill dir created by root; chmod 555 applied by hardening scripts; Kubernetes volume mounted readOnly:true; shared directory with restricted ACLs.","solutions":["Grant write access: chown presto:presto <spill-path> or chmod u+w <spill-path>.","If in Kubernetes, set the volume's readOnly to false and ensure the pod's securityContext fsUser can write.","Verify as the running user: sudo -u presto touch <spill-path>/.writetest.","Update experimental.spiller-spill-path to a directory the service user actually owns."],"exampleFix":"// before\n// dr-xr-xr-x root root /var/spill\n\n// after (shell)\n// chown presto:presto /var/spill && chmod u+rwx /var/spill","handlingStrategy":"validation","validationCode":"for (Path p : spillPaths) {\n    java.io.File f = p.toFile();\n    if (!f.canWrite()) {\n        throw new IllegalStateException(\"Spill path not writable by current user \" + System.getProperty(\"user.name\") + \": \" + p);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["chown spill directories to the Presto service user at deploy time","Avoid readOnly volume mounts for spill paths in containers","Re-verify permissions after OS hardening or security-script runs"],"tags":["spill","filesystem","permissions","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"}