{"record":{"id":"740681e93953612b","repo":"elastic/elasticsearch","slug":"field-has-an-attachment-field-size-of-by-740681","errorCode":null,"errorMessage":"field [{}] has an attachment field size of [{}] bytes exceeding the maximum allowed processor size of [{}] bytes","messagePattern":"field \\[(.+?)\\] has an attachment field size of \\[(.+?)\\] bytes exceeding the maximum allowed processor size of \\[(.+?)\\] bytes","errorType":"exception","errorClass":"ElasticsearchParseException","httpStatus":null,"severity":"error","filePath":"modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/AttachmentProcessor.java","lineNumber":161,"sourceCode":"                throw new ElasticsearchParseException(\n                    \"field [{}] has an attachment field size of [{}] bytes exceeding the maximum allowed input size {}\",\n                    field,\n                    fieldSizeBytes,\n                    maxFieldSizeExceededMessage\n                );\n            }\n            throw new ElasticsearchParseException(\n                \"field [{}] has an attachment field size of [{}] bytes exceeding the maximum allowed input size of [{}] bytes \"\n                    + \"due to setting [{}={}]\",\n                field,\n                fieldSizeBytes,\n                maxFieldSizeFromNodeBytes,\n                MAX_FIELD_SIZE_SETTING.getKey(),\n                maxFieldSizeFromNode.getStringRep()\n            );\n        }\n        if (maxFieldBytesFromProcessor >= 0 && fieldSizeBytes > maxFieldBytesFromProcessor) {\n            throw new ElasticsearchParseException(\n                \"field [{}] has an attachment field size of [{}] bytes exceeding the maximum allowed processor size of [{}] bytes\",\n                field,\n                fieldSizeBytes,\n                maxFieldBytesFromProcessor\n            );\n        }\n    }\n\n    boolean isIgnoreMissing() {\n        return ignoreMissing;\n    }\n\n    // For tests only\n    boolean isRemoveBinary() {\n        return removeBinary;\n    }\n\n    // For tests only","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/AttachmentProcessor.java#L143-L179","documentation":"ElasticsearchParseException when the per-processor cap (max_field_bytes in the attachment processor configuration) is set to >= 0 and the field's raw bytes exceed it. This is independent of, and in addition to, the node-level max_field_size cap — whichever is stricter wins.","triggerScenarios":"Pipeline defines the attachment processor with a numeric max_field_bytes and a document's field raw bytes exceed it. The second if-branch in checkMaxAttachmentFieldSize triggers (after the node-level check passes).","commonSituations":"Per-pipeline guard tighter than node default; different pipelines for different document classes with distinct budgets; mis-typed byte value.","solutions":["Raise the max_field_bytes value in the processor config (PUT _ingest/pipeline)","Filter oversized documents before they reach this pipeline","Set max_field_bytes to -1 to rely solely on the node-level cap"],"exampleFix":"// before\nPUT _ingest/pipeline/attach\n{\"processors\":[{\"attachment\":{\"field\":\"data\",\"max_field_bytes\":10485760}}]}\n// after\n{\"processors\":[{\"attachment\":{\"field\":\"data\",\"max_field_bytes\":52428800}}]}","handlingStrategy":"validation","validationCode":"// Enforce the per-processor cap on the client side:\nint cap = processorConfig.max_field_bytes;\nif (cap >= 0 && doc.fieldRawBytes > cap) { rejectOrRoute(doc); }","typeGuard":null,"tryCatchPattern":"try { ingest(pipeline); }\ncatch (ElasticsearchParseException e) {\n    if (e.getMessage().contains(\"maximum allowed processor size\")) { /* raise cap or shrink input */ }\n    else throw e;\n}","preventionTips":["Use distinct pipelines with tailored max_field_bytes per document class","Validate incoming document sizes at the gateway before routing to ingest","Document the per-processor cap alongside each pipeline definition"],"tags":["ingest","attachment","processor-config","size-limit"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}