{"record":{"id":"4d39307162687729","repo":"apache/druid","slug":"file-does-not-exist-s","errorCode":null,"errorMessage":"File does not exist : %s","messagePattern":"File does not exist : (.+?)","errorType":"exception","errorClass":"ISE","httpStatus":null,"severity":"error","filePath":"multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/DurableStorageTaskOutputChannelFactory.java","lineNumber":124,"sourceCode":"  {\n    final String fileName = getFileNameWithPathForPartition(partitionNumber);\n    final WritableFrameFileChannel writableChannel =\n        new WritableFrameFileChannel(\n            FrameFileWriter.open(\n                Channels.newChannel(storageConnector.write(fileName)),\n                null,\n                ByteTracker.unboundedTracker(),\n                wireTransferableContext\n            )\n        );\n\n    return OutputChannel.pair(\n        writableChannel,\n        ArenaMemoryAllocator.createOnHeap(frameSize),\n        () -> {\n          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        },","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/multi-stage-query/src/main/java/org/apache/druid/msq/shuffle/output/DurableStorageTaskOutputChannelFactory.java#L106-L142","documentation":"DurableStorageTaskOutputChannelFactory.openChannel throws this ISE in the OutputChannel's cleanup/close path when the just-written frame file is not visible via storageConnector.pathExists. The producer wrote its output to durable storage but a verification read of the file path failed, indicating the write did not land or is not yet visible in deep storage.","triggerScenarios":"openChannel wraps the writable channel with a close/verify hook: on channel completion it checks pathExists(fileName) and throws ISE when the file cannot be found — caused by failed upload, wrong configured path/prefix, or eventual-consistency lag in the storage backend.","commonSituations":"Transient deep-storage upload failures (S3 5xx/network) silently swallowed by wrapping in RuntimeException; mismatched druid.storage durableStorage path configuration; eventual-consistency lag on some object stores.","solutions":["Check the producer task logs for the underlying wrapped exception (RuntimeException(exception)) showing the actual storage error.","Verify the file exists in deep storage at the expected location and compare with the configured durableStorage path/prefix.","Retry the query/task; if it recurs, investigate the storage connector's upload reliability and consistency behavior.","Ensure sufficient deep-storage client retry/timeout settings."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// after write, before consuming\nif (!storageConnector.pathExists(expectedOutputFile)) {\n  throw new IllegalStateException(\"Written frame file not visible in deep storage: \" + expectedOutputFile);\n}","typeGuard":null,"tryCatchPattern":"try {\n  runQuery();\n} catch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"File does not exist\")) {\n    inspectTaskLogsForUploadFailure(); // the cause chain holds the storage error\n  }\n  throw e;\n}","preventionTips":["Watch task logs for wrapped storage exceptions; fix upload reliability first.","Verify durableStorage path/prefix settings on all task types.","Enable storage-client retry policies for transient object-store failures."],"tags":["deep-storage","msq","write-verification","object-store"],"backgroundTag":"file-not-found","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"}