apache/cassandra · error · InvalidRequestException
Unknown " + clazz.getName() + ": '" + input + "'
Error message
Unknown " + clazz.getName() + ": '" + input + "'
What it means
The generic parse helper in AccordDebugKeyspace converts a user-supplied string to an enum (or similar type) via a valueOf function, optionally uppercasing first. IllegalArgumentException or NullPointerException from that conversion is rethrown as an InvalidRequestException that names the Java class and the offending input, so the caller knows exactly which value failed to map.
Source
Thrown at src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:2536
}
private static AccordTracing tracing()
{
return ((AccordAgent)AccordService.unsafeInstance().agent()).tracing();
}
private static <E extends Enum<E>> E tryParse(Object input, boolean toUpperCase, Class<E> clazz, Function<String, E> valueOf)
{
try
{
String str = (String) input;
if (toUpperCase)
str = LocalizeString.toUpperCaseLocalized(str, Locale.ENGLISH);
return valueOf.apply(str);
}
catch (IllegalArgumentException | NullPointerException e)
{
throw new InvalidRequestException("Unknown " + clazz.getName() + ": '" + input + '\'');
}
}
private static CoordinationKinds tryParseCoordinationKinds(Object input)
{
if (input == null)
return null;
return CoordinationKinds.parse((String) input);
}
private static TxnKindsAndDomains tryParseTxnKinds(Object input)
{
if (input == null)
return null;
return TxnKindsAndDomains.parse((String) input);
}View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Use exactly one of the target enum's constant names (case-insensitive if the helper uppercases) — the class name in the message tells you which enum
- Check the enum's constants for your Cassandra version (javap or source) rather than trusting external docs
- Remove stray quotes/whitespace from the value
Example fix
// before UPDATE system.accord_debug SET coordination_kind = 'range_read'; // after UPDATE system.accord_debug SET coordination_kind = 'RangeRead'; // must match a constant of the class named in the error
Defensive patterns
Strategy: validation
Validate before calling
// validate against the exact enum class named in the error before writing
boolean valid = value != null && java.util.Arrays.stream(TheEnum.values())
.anyMatch(c -> c.name().equalsIgnoreCase(value.trim())); Type guard
boolean isValidEnumName(Class<? extends Enum<?>> type, Object v) {
return v instanceof String s && java.util.Arrays.stream(type.getEnumConstants())
.anyMatch(c -> c.name().equalsIgnoreCase(s.trim()));
} Try / catch
try {
session.execute(update);
} catch (InvalidRequestException e) {
if (e.getMessage().startsWith("Unknown ")) {
// message names the expected class; pick a valid constant and retry
}
} Prevention
- Parse the class name out of the error message and enumerate its constants
- Keep enum-name lists version-pinned; verify after upgrading Cassandra
- Trim and uppercase values before sending to match the helper's normalization
When it happens
Trigger: Setting a string column on an Accord debug virtual table that is parsed into an enum type (e.g. a coordination kind, mode, or status field) with a name that does not match any constant of that enum, or passing null.
Common situations: Typos in enum names in cqlsh sessions; version drift where the enum constant was added/renamed so older docs no longer match; pasting values with quotes/whitespace; using lowercase where the value must be uppercase (though the helper usually uppercases).
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- <id> is not a valid Transformation.Kind id
- Could not parse TokenKey " + vs[i]
- category %s not found in %s
- GRANT operation is not supported by AllowAllAuthorizer
- REVOKE operation is not supported by AllowAllAuthorizer
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/6d54997c44ca3cbc.
Report an issue: GitHub.