{"record":{"id":"8aff5bce97a8d964","repo":"apache/druid","slug":"unable-to-read-file-s","errorCode":null,"errorMessage":"Unable to read file : %s","messagePattern":"Unable to read file : (.+?)","errorType":"exception","errorClass":"UncheckedIOException","httpStatus":null,"severity":"error","filePath":"multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/DurableStorageTaskOutputChannelFactory.java","lineNumber":140,"sourceCode":"          try {\n            if (!storageConnector.pathExists(fileName)) {\n              throw new ISE(\"File does not exist : %s\", fileName);\n            }\n          }\n          catch (Exception exception) {\n            throw new RuntimeException(exception);\n          }\n          try {\n            return ReadableInputStreamFrameChannel.open(\n                storageConnector.read(fileName),\n                fileName,\n                remoteInputStreamPool,\n                false,\n                wireTransferableContext\n            );\n          }\n          catch (IOException e) {\n            throw new UncheckedIOException(StringUtils.format(\"Unable to read file : %s\", fileName), e);\n          }\n        },\n        partitionNumber\n    );\n  }\n\n  @Override\n  public PartitionedOutputChannel openPartitionedChannel(String name, boolean deleteAfterRead) throws IOException\n  {\n    final String fileName = DurableStorageUtils.getOutputsFileNameForPath(\n        controllerTaskId,\n        stageNumber,\n        workerNumber,\n        taskId,\n        name\n    );\n    final CountingOutputStream countingOutputStream = new CountingOutputStream(storageConnector.write(fileName));\n    final WritableFrameFileChannel writableChannel =","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/DurableStorageTaskOutputChannelFactory.java#L122-L158","documentation":"When reading back the written frame file, openChannel wraps any IOException from opening the remote input stream in an UncheckedIOException with message 'Unable to read file : %s'. The file path exists (checked earlier) but opening the read stream failed — typically a storage-client-level error.","triggerScenarios":"The read lambda in openChannel calls storageConnector.read / remoteInputStreamPool to open the partition output file and receives an IOException: transient deep-storage outage, permission/credential errors, file deleted between existence check and read, throttling by the object store.","commonSituations":"Expired cloud credentials (S3/GCS/Azure) mid-query; object-store throttling (429) during large shuffles; security/plugin misconfiguration denying read access; concurrent cleanup deleting the file.","solutions":["Look at the wrapped IOException cause for the storage-specific error code (access denied, throttled, not found).","Verify credentials and IAM permissions for reading the durable-storage location.","Add/increase retry and backoff settings on the storage connector client.","Ensure deep-storage cleanup jobs are not deleting the query's intermediate prefix while the query runs."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// preflight read check on the storage location\nstorageConnector.read(knownProbeKey).close(); // throws IOException early if credentials/permissions are broken","typeGuard":null,"tryCatchPattern":"try {\n  readOutput();\n} catch (UncheckedIOException e) {\n  if (isRetryable(e.getCause())) { retryWithBackoff(); } else { throw e; }\n}","preventionTips":["Grant tasks read IAM permissions on the durable-storage prefix.","Refresh credentials before expiry for long-running queries.","Prevent cleanup jobs from deleting intermediate prefixes mid-query."],"tags":["deep-storage","msq","io-error","object-store"],"backgroundTag":"file-read-failed","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}