{"record":{"id":"1c9034636e13a0a1","repo":"apache/hadoop","slug":"gzip-data-not-compressed-with-deflate-method","errorCode":null,"errorMessage":"gzip data not compressed with deflate method","messagePattern":"gzip data not compressed with deflate method","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zlib/BuiltInGzipDecompressor.java","lineNumber":514,"sourceCode":"   * the start of localBuf).</p>\n   */\n  /*\n   * Flag bits (remainder are reserved and must be zero):\n   *   bit 0   FTEXT\n   *   bit 1   FHCRC   (never implemented in gzip, at least through version\n   *                   1.4.0; instead interpreted as \"continuation of multi-\n   *                   part gzip file,\" which is unsupported through 1.4.0)\n   *   bit 2   FEXTRA\n   *   bit 3   FNAME\n   *   bit 4   FCOMMENT\n   *  [bit 5   encrypted]\n   */\n  private void processBasicHeader() throws IOException {\n    if (readUShortLE(localBuf, 0) != GZIP_MAGIC_ID) {\n      throw new IOException(\"not a gzip file\");\n    }\n    if (readUByte(localBuf, 2) != GZIP_DEFLATE_METHOD) {\n      throw new IOException(\"gzip data not compressed with deflate method\");\n    }\n    int flg = readUByte(localBuf, 3);\n    if ((flg & GZIP_FLAGBITS_RESERVED) != 0) {\n      throw new IOException(\"unknown gzip format (reserved flagbits set)\");\n    }\n    hasExtraField = ((flg & GZIP_FLAGBIT_EXTRA_FIELD) != 0);\n    hasFilename   = ((flg & GZIP_FLAGBIT_FILENAME)    != 0);\n    hasComment    = ((flg & GZIP_FLAGBIT_COMMENT)     != 0);\n    hasHeaderCRC  = ((flg & GZIP_FLAGBIT_HEADER_CRC)  != 0);\n  }\n\n  private void checkAndCopyBytesToLocal(int len) {\n    System.arraycopy(userBuf, userBufOff, localBuf, localBufOff, len);\n    localBufOff += len;\n    // alternatively, could call checkAndSkipBytes(len) for rest...\n    crc.update(userBuf, userBufOff, len);\n    userBufOff += len;\n    userBufLen -= len;","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zlib/BuiltInGzipDecompressor.java#L496-L532","documentation":"Error \"gzip data not compressed with deflate method\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zlib/BuiltInGzipDecompressor.java:514 when the library encounters an invalid state.","commonSituations":"Occurs when the gzip header's compression method byte is not 8 (deflate). Only deflate-compressed gzip members are supported; reject other formats before decompressing.","solutions":["Only compression method 8 (deflate) is supported; re-encode the file with standard gzip.","Inspect the file header; it may be produced by a non-standard tool."],"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-23T01:17:44.959Z"}