jruby/jruby · error · Zlib::StreamError

stream error: ${iae.getMessage()}

Error message

stream error: ${iae.getMessage()}

What it means

Error "stream error: ${iae.getMessage()}" thrown in jruby/jruby.

Source

Thrown at core/src/main/java/org/jruby/ext/zlib/JZlibInflate.java:180

             case 1 -> context.tru;
             case JZlib.Z_DATA_ERROR -> throw RubyZlib.newStreamError(context, "stream error");
             default -> context.fals;
        };
    }

    @JRubyMethod(name = "set_dictionary")
    public IRubyObject set_dictionary(ThreadContext context, IRubyObject arg) {
        try {
            byte[] tmp = arg.convertToString().getBytes();
            int ret = flater.setDictionary(tmp, tmp.length);
            switch (ret) {
                case JZlib.Z_STREAM_ERROR -> throw RubyZlib.newStreamError(context, "stream error");
                case JZlib.Z_DATA_ERROR -> throw RubyZlib.newDataError(context, "wrong dictionary");
            }
            run(context, false);
            return arg;
        } catch (IllegalArgumentException iae) {
            throw RubyZlib.newStreamError(context, "stream error: " + iae.getMessage());
        }
    }

    @JRubyMethod(name = "inflate")
    public IRubyObject inflate(ThreadContext context, IRubyObject string, Block block) {
        ByteList data = null;
        if (!string.isNil()) {
            data = string.convertToString().getByteList();
        }
        return inflate(context, data, block);
    }

    public IRubyObject inflate(ThreadContext context, ByteList str, Block block) {
        if (str == null) return internalFinish(context, block);

        append(context, str);
        return flushOutput(context, block);
    }

View on GitHub (pinned to fb650c13e0)

Solutions

  1. An IllegalArgumentException occurred during inflate. Read the wrapped message and correct the invalid parameter (window bits, dictionary, or buffer).

When it happens

Trigger: Thrown at core/src/main/java/org/jruby/ext/zlib/JZlibInflate.java:180 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/b36cd2e6e0af8bac. Report an issue: GitHub.