{"record":{"id":"c65c577dcaed7c9a","repo":"prestodb/presto","slug":"spooling-storage-error","errorCode":"SPOOLING_STORAGE_ERROR","errorMessage":"Failed to read file from TempStorage","messagePattern":"Failed to read file from TempStorage","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/execution/buffer/SpoolingOutputBuffer.java","lineNumber":418,"sourceCode":"                bytes += page.getRetainedSizeInBytes();\n\n                if (pageCount != 0 && bytes > maxBytes) {\n                    getTracker.update(bytesRead, pageCount);\n                    return immediateFuture(resultBuilder.build());\n                }\n                resultBuilder.add(page);\n                pageCount++;\n            }\n\n            getTracker.update(bytes, pageCount);\n\n            if (!handleIterator.hasNext()) {\n                return immediateFuture(resultBuilder.build());\n            }\n            return transformAsync(handleIterator.next().getHandleFuture(), input -> getPagesFromStorage(resultBuilder, handleIterator, input, getTracker), executor);\n        }\n        catch (IOException e) {\n            throw new PrestoException(SPOOLING_STORAGE_ERROR, \"Failed to read file from TempStorage\", e);\n        }\n    }\n\n    private List<SerializedPage> getPagesFromMemory(long startSequenceId, GetTracker getTracker)\n    {\n        checkArgument(startSequenceId == currentMemorySequenceId.get(), \"Invalid startSequenceId for memory pages\");\n        checkArgument(getTracker.bytes < getTracker.maxSizeInBytes, \"bytesRead is greater than maxSize\");\n\n        ImmutableList.Builder<SerializedPage> result = ImmutableList.builder();\n        List<SerializedPage> pages = getTracker.getMemoryPages();\n        long maxBytes = getTracker.maxSizeInBytes;\n        long bytes = 0;\n        long pageCount = 0;\n\n        for (SerializedPage page : pages) {\n            bytes += page.getRetainedSizeInBytes();\n            if (pageCount != 0 && bytes > maxBytes) {\n                break;","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/execution/buffer/SpoolingOutputBuffer.java#L400-L436","documentation":"I/O failure inside getPagesFromStorage while a client fetches pages that were spilled to TempStorage by the spooling output buffer: reading a spooled file backing a handle failed, so buffered result pages cannot be returned to the client.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/execution/buffer/SpoolingOutputBuffer.java:418 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the query; transient temp-storage failures usually clear up","Check TempStorage health and disk space on the coordinator and workers","Inspect coordinator logs for the underlying IOException to identify the failing spooled file","If persistent, disable or reconfigure spooling output buffers and rerun"],"exampleFix":null,"handlingStrategy":"retry","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"}