elastic/elasticsearch · error · ElasticsearchException

<wrapped IOException>

Error message

<wrapped IOException>

What it means

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.

Source

Thrown at modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/HtmlStripProcessor.java:41

    HtmlStripProcessor(String tag, String description, String field, boolean ignoreMissing, String targetField) {
        super(tag, description, ignoreMissing, targetField, field);
    }

    @Override
    protected String process(String value) {
        // shortcut, no need to create a string builder and go through each char
        if (value.contains("<") == false || value.contains(">") == false) {
            return value;
        }

        StringBuilder builder = new StringBuilder();
        try (HTMLStripCharFilter filter = new HTMLStripCharFilter(new StringReader(value))) {
            int ch;
            while ((ch = filter.read()) != -1) {
                builder.append((char) ch);
            }
        } catch (IOException e) {
            throw new ElasticsearchException(e);
        }

        return builder.toString();
    }

    @Override
    public String getType() {
        return TYPE;
    }

    public static final class Factory extends AbstractStringProcessor.Factory {

        public Factory() {
            super(TYPE);
        }

        @Override
        protected HtmlStripProcessor newProcessor(

View on GitHub (pinned to db6a809a66)

Solutions

  1. Inspect the wrapped IOException cause via server logs to identify the Lucene-level failure.
  2. Sanitize or pre-truncate the input string before html_strip.
  3. Open a bug against Lucene/Elasticsearch with the reproducer if the cause indicates an internal fault.
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-validate the string is parseable / not adversarial
if (value.length() > MAX_HTML_LEN) {
    value = value.substring(0, MAX_HTML_LEN);
}

Try / catch

try {
    htmlStripProcessor.execute(doc);
} catch (ElasticsearchException e) {
    if (e.getCause() instanceof IOException) {
        // log and route to failure store
    } else throw e;
}

Prevention

When it happens

Trigger: Processing a string containing '<' and '>' through html_strip where the underlying char filter encounters an internal error reading characters.

Common situations: Malformed or adversarial HTML-like content triggering edge cases in the Lucene HTMLStripCharFilter; very rare; usually reproducible with specific malformed input.

Related errors


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