{"record":{"id":"eb0f497a744311fb","repo":"apache/hadoop","slug":"writing-less-bytes-than-advertised-size","errorCode":null,"errorMessage":"Writing less bytes than advertised size.","messagePattern":"Writing less bytes than advertised size\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Chunk.java","lineNumber":422,"sourceCode":"      } else {\n        throw new IOException(\"Writing more bytes than advertised size.\");\n      }\n    }\n\n    @Override\n    public void flush() throws IOException {\n      out.flush();\n    }\n\n    @Override\n    public void close() throws IOException {\n      if (closed == true) {\n        return;\n      }\n\n      try {\n        if (remain > 0) {\n          throw new IOException(\"Writing less bytes than advertised size.\");\n        }\n      } finally {\n        closed = true;\n      }\n    }\n  }\n}\n","sourceCodeStart":404,"sourceCodeEnd":430,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Chunk.java#L404-L430","documentation":"Error \"Writing less bytes than advertised size.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/Chunk.java:422 when the library encounters an invalid state.","commonSituations":"Occurs when a chunk is closed with fewer bytes written than advertised. Write exactly the declared number of bytes or declare the correct size.","solutions":["Flush and close only after writing the full advertised entry size; do not close the appender early."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}