{"record":{"id":"93b1b5c491dcf5d4","repo":"apache/druid","slug":"cannot-open-writer","errorCode":null,"errorMessage":"Cannot open writer","messagePattern":"Cannot open writer","errorType":"exception","errorClass":"UnsupportedOperationException (UOE)","httpStatus":null,"severity":"error","filePath":"extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java","lineNumber":260,"sourceCode":"        throw new UOE(\"Cannot stream S3 output\");\n      }\n\n      @Override\n      public Reader openReader(boolean ignoreEncodingErrors)\n      {\n        throw new UOE(\"Cannot open reader\");\n      }\n\n      @Override\n      public CharSequence getCharContent(boolean ignoreEncodingErrors)\n      {\n        throw new UOE(\"Cannot open character sequence\");\n      }\n\n      @Override\n      public Writer openWriter()\n      {\n        throw new UOE(\"Cannot open writer\");\n      }\n\n      @Override\n      public long getLastModified()\n      {\n        if (s3InputStream != null) {\n          Instant lastModified = s3InputStream.response().lastModified();\n          return lastModified != null ? lastModified.toEpochMilli() : 0L;\n        }\n        if (objectMetadata == null) {\n          objectMetadata = S3Utils.getSingleObjectMetadata(s3Client, coords.getBucket(), coords.getPath());\n        }\n        Instant lastModified = objectMetadata.lastModified();\n        return lastModified != null ? lastModified.toEpochMilli() : 0L;\n      }\n\n      @Override\n      public boolean delete()","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java#L242-L278","documentation":"Sentinel unsupported-operation inside the anonymous SimpleJavaFileObject built around the S3 input stream in S3DataSegmentPuller: only read-oriented operations (openInputStream, char content) are meaningful for segment data pulled from S3, so openWriter() is hard-coded to throw. It is never caused by S3 or user data — it only fires if something tries to treat the read-only S3-backed file object as writable.","triggerScenarios":"Thrown at extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentPuller.java:260 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the S3 storage uploader for writes instead of the segment puller's FileObject.","Restructure code so write operations target local or writable storage."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}