jruby/jruby · error · Zlib::GzipFile::CRCError

invalid compressed data -- crc error

Error message

invalid compressed data -- crc error

What it means

Error "invalid compressed data -- crc error" thrown in jruby/jruby.

Source

Thrown at core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java:340

            if (argc == 0 || args[0].isNil()) return readAll(context);

            int len = toInt(context, args[0]);
            if (len < 0) throw argumentError(context, "negative length " + len + " given");
            if (len > 0) { // rb_gzfile_read
                ByteList buf = readSize(len);
                return buf == null ? context.nil : newString(context, buf);
            }

            return RubyString.newEmptyBinaryString(context.runtime);
        } catch (IOException ioe) {
            String m = ioe.getMessage();

            if (m.startsWith("Unexpected end of ZLIB input stream")) {
                throw RubyZlib.newGzipFileError(context, ioe.getMessage());
            } else if (m.startsWith("footer is not found")) {
                throw RubyZlib.newNoFooter(context, "footer is not found");
            } else if (m.startsWith("incorrect data check")) {
                throw RubyZlib.newCRCError(context, "invalid compressed data -- crc error");
            } else if (m.startsWith("incorrect length check")) {
                throw RubyZlib.newLengthError(context, "invalid compressed data -- length error");
            } else {
                throw RubyZlib.newDataError(context, ioe.getMessage());
            }
        }
    }

    @Deprecated(since = "10.0.0.0")
    public IRubyObject readpartial(IRubyObject[] args) {
        return readpartial(getCurrentContext(), args);
    }

    @JRubyMethod(name = "readpartial", required = 1, optional = 1, checkArity = false)
    public IRubyObject readpartial(ThreadContext context, IRubyObject[] args) {
        int argc = Arity.checkArgumentCount(context, args, 1, 2);

        try {

View on GitHub (pinned to fb650c13e0)

Solutions

  1. The gzip CRC check failed, meaning the data is corrupt. Re-obtain or regenerate the gzip file; verify transfer integrity (binary mode, complete download).

When it happens

Trigger: Thrown at core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java:340 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jruby/jruby@fb650c13e0 (2026-08-23). Data as JSON: /api/errors/d25bfc8c2866720c. Report an issue: GitHub.