{"record":{"id":"0723ef818dac3336","repo":"elastic/elasticsearch","slug":"wrapped-ioexception","errorCode":null,"errorMessage":"<wrapped IOException>","messagePattern":"<wrapped IOException>","errorType":"exception","errorClass":"ElasticsearchException","httpStatus":null,"severity":"error","filePath":"modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/HtmlStripProcessor.java","lineNumber":41,"sourceCode":"    HtmlStripProcessor(String tag, String description, String field, boolean ignoreMissing, String targetField) {\n        super(tag, description, ignoreMissing, targetField, field);\n    }\n\n    @Override\n    protected String process(String value) {\n        // shortcut, no need to create a string builder and go through each char\n        if (value.contains(\"<\") == false || value.contains(\">\") == false) {\n            return value;\n        }\n\n        StringBuilder builder = new StringBuilder();\n        try (HTMLStripCharFilter filter = new HTMLStripCharFilter(new StringReader(value))) {\n            int ch;\n            while ((ch = filter.read()) != -1) {\n                builder.append((char) ch);\n            }\n        } catch (IOException e) {\n            throw new ElasticsearchException(e);\n        }\n\n        return builder.toString();\n    }\n\n    @Override\n    public String getType() {\n        return TYPE;\n    }\n\n    public static final class Factory extends AbstractStringProcessor.Factory {\n\n        public Factory() {\n            super(TYPE);\n        }\n\n        @Override\n        protected HtmlStripProcessor newProcessor(","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/HtmlStripProcessor.java#L23-L59","documentation":"HtmlStripProcessor.execute wraps any IOException thrown by HTMLStripCharFilter (a Lucene analyzer component reading the input string) into an ElasticsearchException. The placeholder message indicates the original IOException is set as the cause. In practice this is rare — HTMLStripCharFilter reads from an in-memory StringReader, so an IOException signals a parser/library bug rather than a real I/O fault.","triggerScenarios":"Processing a string containing '<' and '>' through html_strip where the underlying char filter encounters an internal error reading characters.","commonSituations":"Malformed or adversarial HTML-like content triggering edge cases in the Lucene HTMLStripCharFilter; very rare; usually reproducible with specific malformed input.","solutions":["Inspect the wrapped IOException cause via server logs to identify the Lucene-level failure.","Sanitize or pre-truncate the input string before html_strip.","Open a bug against Lucene/Elasticsearch with the reproducer if the cause indicates an internal fault."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-validate the string is parseable / not adversarial\nif (value.length() > MAX_HTML_LEN) {\n    value = value.substring(0, MAX_HTML_LEN);\n}","typeGuard":null,"tryCatchPattern":"try {\n    htmlStripProcessor.execute(doc);\n} catch (ElasticsearchException e) {\n    if (e.getCause() instanceof IOException) {\n        // log and route to failure store\n    } else throw e;\n}","preventionTips":["Sanitize or truncate extremely long HTML inputs before html_strip.","Monitor for repeated failures on specific documents and report upstream bugs.","Keep Lucene/Elasticsearch patched to pick up HTMLStripCharFilter fixes."],"tags":["ingest","html-strip","lucene","ioexception"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}