{"record":{"id":"6ebe3e07a56c8084","repo":"prestodb/presto","slug":"generic-spill-failure-6ebe3e","errorCode":"GENERIC_SPILL_FAILURE","errorMessage":"Failed to create spill file: %s","messagePattern":"Failed to create spill file: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/spiller/FileSingleStreamSpiller.java","lineNumber":111,"sourceCode":"        this.spillCipher = requireNonNull(spillCipher, \"spillCipher is null\");\n        checkState(!spillCipher.isPresent() || !spillCipher.get().isDestroyed(), \"spillCipher is already destroyed\");\n        this.spillCipher.ifPresent(cipher -> closer.register(cipher::destroy));\n        // HACK!\n        // The writePages() method is called in a separate thread pool and it's possible that\n        // these spiller thread can run concurrently with the close() method.\n        // Due to this race when the spiller thread is running, the driver thread:\n        // 1. Can zero out the memory reservation even though the spiller thread physically holds onto that memory.\n        // 2. Can close/delete the temp file(s) used for spilling, which doesn't have any visible side effects, but still not desirable.\n        // To hack around the first issue we reserve the memory in the constructor and we release it in the close() method.\n        // This means we start accounting for the memory before the spiller thread allocates it, and we release the memory reservation\n        // before/after the spiller thread allocates that memory -- -- whether before or after depends on whether writePages() is in the\n        // middle of execution when close() is called (note that this applies to both readPages() and writePages() methods).\n        this.memoryContext.setBytes(BUFFER_SIZE);\n        try {\n            this.targetFile = closer.register(new FileHolder(Files.createTempFile(spillPath, SPILL_FILE_PREFIX, SPILL_FILE_SUFFIX)));\n        }\n        catch (IOException e) {\n            throw new PrestoException(GENERIC_SPILL_FAILURE, format(\"Failed to create spill file: %s\", e.getMessage()), e);\n        }\n    }\n\n    @Override\n    public ListenableFuture<?> spill(Iterator<Page> pageIterator)\n    {\n        requireNonNull(pageIterator, \"pageIterator is null\");\n        checkNoSpillInProgress();\n        spillInProgress = executor.submit(() -> writePages(pageIterator));\n        return spillInProgress;\n    }\n\n    @Override\n    public long getSpilledPagesInMemorySize()\n    {\n        return spilledPagesInMemorySize;\n    }\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/spiller/FileSingleStreamSpiller.java#L93-L129","documentation":"Runtime error from FileSingleStreamSpiller: creating the temporary spill file on the configured spill filesystem failed (IOException wrapped). This is an environment/infrastructure failure of the spill path, not a query-logic problem; the %s names the file that could not be created.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/spiller/FileSingleStreamSpiller.java:111 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the spill filesystem has free space and correct permissions for the Presto process user","Verify experimental.spiller-spill-path points to a valid, writable local directory","Ensure the spill disk is not full or read-only; clean up stale spill files"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}