elastic/elasticsearch · error · UnsupportedOperationException
deprecated fields not supported here but got [{oldName}] whi
Error message
deprecated fields not supported here but got [{oldName}] which has been replaced with [{currentName}] What it means
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.
Source
Thrown at libs/x-content/src/main/java/org/elasticsearch/xcontent/DeprecationHandler.java:62
}
}
@Override
public void logRenamedField(String parserName, Supplier<XContentLocation> location, String oldName, String currentName) {
if (parserName != null) {
throw new UnsupportedOperationException(
"deprecated fields not supported in ["
+ parserName
+ "] but got ["
+ oldName
+ "] at ["
+ location.get()
+ "] which has been replaced with ["
+ currentName
+ "]"
);
} else {
throw new UnsupportedOperationException(
"deprecated fields not supported here but got [" + oldName + "] which has been replaced with [" + currentName + "]"
);
}
}
@Override
public void logRemovedField(String parserName, Supplier<XContentLocation> location, String removedName) {
if (parserName != null) {
throw new UnsupportedOperationException(
"deprecated fields not supported in ["
+ parserName
+ "] but got ["
+ removedName
+ "] at ["
+ location.get()
+ "] which has been deprecated entirely"
);
} else {View on GitHub (pinned to db6a809a66)
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.
Defensive patterns
Strategy: validation
Validate before calling
// supply a parserName and rename deprecated aliases to current names pre-parse
Try / catch
try {
p.parse(parser, ctx);
} catch (UnsupportedOperationException e) {
if (e.getMessage().startsWith("deprecated fields not supported here") && e.getMessage().contains("deprecated name for [")) {
// rename to currentName and retry
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Unnamed parsers in shared library code. Test parsers created without parserName that nonetheless enforce deprecation strictly.
Related errors
- deprecated fields not supported in [{parserName}] but got [{
- deprecated fields not supported in [{parserName}] but got [{
- deprecated fields not supported here but got [{oldName}] whi
- deprecated fields not supported in [{parserName}] but got [{
- deprecated fields not supported here but got [{removedName}]
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/ddd4d4bc2154f233.
Report an issue: GitHub.