elastic/elasticsearch · error · IllegalArgumentException

Field [{}] is null, cannot be converted to type [{}]

Error message

Field [{}] is null, cannot be converted to type [{}]

What it means

Thrown by ConvertProcessor.execute when the configured field resolves to null and 'ignore_missing' is false (the default). The processor explicitly distinguishes null from missing: it asks for the value with the ignoreMissing flag, and only returns early if both the value is null AND ignore_missing is true. Any other null result is treated as an unrecoverable conversion failure.

Source

Thrown at modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ConvertProcessor.java:193

    }

    Type getConvertType() {
        return convertType;
    }

    boolean isIgnoreMissing() {
        return ignoreMissing;
    }

    @Override
    public IngestDocument execute(IngestDocument document) {
        Object oldValue = document.getFieldValue(field, Object.class, ignoreMissing);
        Object newValue;

        if (oldValue == null && ignoreMissing) {
            return document;
        } else if (oldValue == null) {
            throw new IllegalArgumentException("Field [" + field + "] is null, cannot be converted to type [" + convertType + "]");
        }

        if (oldValue instanceof List<?> list) {
            List<Object> newList = new ArrayList<>(list.size());
            for (Object value : list) {
                newList.add(convertType.convert(value));
            }
            newValue = newList;
        } else {
            newValue = convertType.convert(oldValue);
        }
        document.setFieldValue(targetField, newValue);
        return document;
    }

    @Override
    public String getType() {
        return TYPE;

View on GitHub (pinned to db6a809a66)

Solutions

  1. Add 'ignore_missing: true' to the convert processor configuration so absent or null fields skip the processor instead of failing.
  2. Ensure the upstream producer populates the field, or add a 'set' processor with a default value before the convert step.
  3. Use a pipeline 'on_failure' block to redirect such documents to a dead-letter index.

Example fix

// before
{"convert": {"field": "price", "type": "float"}}
// after
{"convert": {"field": "price", "type": "float", "ignore_missing": true}}
Defensive patterns

Strategy: validation

Validate before calling

// Defensive: set ignore_missing on every convert processor by default in pipeline templates.
{"convert": {"field": "price", "type": "float", "ignore_missing": true}}

Try / catch

// Pipeline on_failure to catch the rare null field that still sneaks through:
{"on_failure": [{"index": {"index": "ingest-dlq"}}]}

Prevention

When it happens

Trigger: A document where the configured 'field' exists but is explicitly JSON null, or where the field is absent and the pipeline did not set 'ignore_missing: true'. The convert processor's default for ignore_missing is false.

Common situations: Optional fields that are sometimes omitted by producers; documents that explicitly carry null after a previous rename or remove; pipelines built before the ignore_missing option existed; mixed schemas where some documents have the field and others do not.

Related errors


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