{"record":{"id":"1378c548805bb29d","repo":"elastic/elasticsearch","slug":"input-length-must-be-0-got","errorCode":null,"errorMessage":"input.length must be > 0 (got {})","messagePattern":"input\\.length must be > 0 \\(got (.+?)\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ESSynonymMapBuilder.java","lineNumber":69,"sourceCode":"    private static class MapEntry {\n        boolean includeOrig;\n        final IntList ords = new IntList();\n    }\n\n    ESSynonymMapBuilder(boolean dedup, CircuitBreaker circuitBreaker) {\n        this.dedup = dedup;\n        this.circuitBreaker = circuitBreaker;\n    }\n\n    void add(CharsRef input, CharsRef output, boolean includeOrig) {\n        int numInputWords = countWords(input);\n        int numOutputWords = countWords(output);\n\n        if (numInputWords <= 0) {\n            throw new IllegalArgumentException(\"numInputWords must be > 0 (got \" + numInputWords + \")\");\n        }\n        if (input.length <= 0) {\n            throw new IllegalArgumentException(\"input.length must be > 0 (got \" + input.length + \")\");\n        }\n        if (numOutputWords <= 0) {\n            throw new IllegalArgumentException(\"numOutputWords must be > 0 (got \" + numOutputWords + \")\");\n        }\n        if (output.length <= 0) {\n            throw new IllegalArgumentException(\"output.length must be > 0 (got \" + output.length + \")\");\n        }\n\n        if ((ruleCount++ & ADD_CHECK_INTERVAL) == 0) {\n            circuitBreaker.addEstimateBytesAndMaybeBreak(0L, \"Synonyms\");\n        }\n\n        assert !hasHoles(input) : \"input has holes: \" + input;\n        assert !hasHoles(output) : \"output has holes: \" + output;\n\n        utf8Scratch.copyChars(output.chars, output.offset, output.length);\n        int ord = words.add(utf8Scratch.get());\n        if (ord < 0) {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ESSynonymMapBuilder.java#L51-L87","documentation":"Error \"input.length must be > 0 (got {})\" thrown in elastic/elasticsearch.","triggerScenarios":"Thrown at modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ESSynonymMapBuilder.java:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}