elastic/elasticsearch · error · IllegalArgumentException

output.length must be > 0 (got {})

Error message

output.length must be > 0 (got {})

What it means

Error "output.length must be > 0 (got {})" thrown in elastic/elasticsearch.

Source

Thrown at modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ESSynonymMapBuilder.java:75

        this.dedup = dedup;
        this.circuitBreaker = circuitBreaker;
    }

    void add(CharsRef input, CharsRef output, boolean includeOrig) {
        int numInputWords = countWords(input);
        int numOutputWords = countWords(output);

        if (numInputWords <= 0) {
            throw new IllegalArgumentException("numInputWords must be > 0 (got " + numInputWords + ")");
        }
        if (input.length <= 0) {
            throw new IllegalArgumentException("input.length must be > 0 (got " + input.length + ")");
        }
        if (numOutputWords <= 0) {
            throw new IllegalArgumentException("numOutputWords must be > 0 (got " + numOutputWords + ")");
        }
        if (output.length <= 0) {
            throw new IllegalArgumentException("output.length must be > 0 (got " + output.length + ")");
        }

        if ((ruleCount++ & ADD_CHECK_INTERVAL) == 0) {
            circuitBreaker.addEstimateBytesAndMaybeBreak(0L, "Synonyms");
        }

        assert !hasHoles(input) : "input has holes: " + input;
        assert !hasHoles(output) : "output has holes: " + output;

        utf8Scratch.copyChars(output.chars, output.offset, output.length);
        int ord = words.add(utf8Scratch.get());
        if (ord < 0) {
            ord = (-ord) - 1;
        }

        MapEntry e = workingSet.get(input);
        if (e == null) {
            e = new MapEntry();

View on GitHub (pinned to db6a809a66)

When it happens

Trigger: Thrown at modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ESSynonymMapBuilder.java:75 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12). Data as JSON: /api/errors/677d981fe45a4d10. Report an issue: GitHub.