{"record":{"id":"ddd4d4bc2154f233","repo":"elastic/elasticsearch","slug":"deprecated-fields-not-supported-here-but-got-old-ddd4d4","errorCode":null,"errorMessage":"deprecated fields not supported here but got [{oldName}] which has been replaced with [{currentName}]","messagePattern":"deprecated fields not supported here but got \\[(.+?)\\] which has been replaced with \\[(.+?)\\]","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"libs/x-content/src/main/java/org/elasticsearch/xcontent/DeprecationHandler.java","lineNumber":62,"sourceCode":"            }\n        }\n\n        @Override\n        public void logRenamedField(String parserName, Supplier<XContentLocation> location, String oldName, String currentName) {\n            if (parserName != null) {\n                throw new UnsupportedOperationException(\n                    \"deprecated fields not supported in [\"\n                        + parserName\n                        + \"] but got [\"\n                        + oldName\n                        + \"] at [\"\n                        + location.get()\n                        + \"] which has been replaced with [\"\n                        + currentName\n                        + \"]\"\n                );\n            } else {\n                throw new UnsupportedOperationException(\n                    \"deprecated fields not supported here but got [\" + oldName + \"] which has been replaced with [\" + currentName + \"]\"\n                );\n            }\n        }\n\n        @Override\n        public void logRemovedField(String parserName, Supplier<XContentLocation> location, String removedName) {\n            if (parserName != null) {\n                throw new UnsupportedOperationException(\n                    \"deprecated fields not supported in [\"\n                        + parserName\n                        + \"] but got [\"\n                        + removedName\n                        + \"] at [\"\n                        + location.get()\n                        + \"] which has been deprecated entirely\"\n                );\n            } else {","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/libs/x-content/src/main/java/org/elasticsearch/xcontent/DeprecationHandler.java#L44-L80","documentation":"logRenamedField, parserName-null variant: a deprecated renamed field alias is encountered under THROW_UNSUPPORTED_OPERATION but the parser has no parserName, so the message drops the parser context. Same semantics as 869 regarding renamed (not replaced) fields.","triggerScenarios":"Strict deprecated-field rejection on an unnamed parser where input uses an old field name that was renamed. Typical of unnamed/ad-hoc parsers in tests or internal utilities.","commonSituations":"Unnamed parsers in shared library code. Test parsers created without parserName that nonetheless enforce deprecation strictly.","solutions":["Send the current field name (currentName in the message).","Supply a parserName to improve diagnostics and/or relax the deprecation handler if legacy names must pass."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// supply a parserName and rename deprecated aliases to current names pre-parse","typeGuard":null,"tryCatchPattern":"try {\n    p.parse(parser, ctx);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().startsWith(\"deprecated fields not supported here\") && e.getMessage().contains(\"deprecated name for [\")) {\n        // rename to currentName and retry\n    }\n}","preventionTips":["Always set parserName on parsers to get the more informative (named) variant.","Translate deprecated 'renamed' aliases to current names before strict parsing.","Use logging handlers during migration to avoid hard failures."],"tags":["xcontent","deprecation","strict","field-rename"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}