{"record":{"id":"d25bfc8c2866720c","repo":"jruby/jruby","slug":"invalid-compressed-data-crc-error","errorCode":null,"errorMessage":"invalid compressed data -- crc error","messagePattern":"invalid compressed data -- crc error","errorType":"exception","errorClass":"Zlib::GzipFile::CRCError","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java","lineNumber":340,"sourceCode":"            if (argc == 0 || args[0].isNil()) return readAll(context);\n\n            int len = toInt(context, args[0]);\n            if (len < 0) throw argumentError(context, \"negative length \" + len + \" given\");\n            if (len > 0) { // rb_gzfile_read\n                ByteList buf = readSize(len);\n                return buf == null ? context.nil : newString(context, buf);\n            }\n\n            return RubyString.newEmptyBinaryString(context.runtime);\n        } catch (IOException ioe) {\n            String m = ioe.getMessage();\n\n            if (m.startsWith(\"Unexpected end of ZLIB input stream\")) {\n                throw RubyZlib.newGzipFileError(context, ioe.getMessage());\n            } else if (m.startsWith(\"footer is not found\")) {\n                throw RubyZlib.newNoFooter(context, \"footer is not found\");\n            } else if (m.startsWith(\"incorrect data check\")) {\n                throw RubyZlib.newCRCError(context, \"invalid compressed data -- crc error\");\n            } else if (m.startsWith(\"incorrect length check\")) {\n                throw RubyZlib.newLengthError(context, \"invalid compressed data -- length error\");\n            } else {\n                throw RubyZlib.newDataError(context, ioe.getMessage());\n            }\n        }\n    }\n\n    @Deprecated(since = \"10.0.0.0\")\n    public IRubyObject readpartial(IRubyObject[] args) {\n        return readpartial(getCurrentContext(), args);\n    }\n\n    @JRubyMethod(name = \"readpartial\", required = 1, optional = 1, checkArity = false)\n    public IRubyObject readpartial(ThreadContext context, IRubyObject[] args) {\n        int argc = Arity.checkArgumentCount(context, args, 1, 2);\n\n        try {","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/jruby/jruby/blob/fb650c13e02b5a600fa66384655069d5ec30c362/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java#L322-L358","documentation":"Error \"invalid compressed data -- crc error\" thrown in jruby/jruby.","triggerScenarios":"Thrown at core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java:340 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The gzip CRC check failed, meaning the data is corrupt. Re-obtain or regenerate the gzip file; verify transfer integrity (binary mode, complete download)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb650c13e02b5a600fa66384655069d5ec30c362","analyzedAt":"2026-08-23T07:18:57.479Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}