apache/cassandra · error · IllegalArgumentException
Unsupported type: + type
Error message
Unsupported type: + type
What it means
In PingRequest.get, the ConnectionType switch has no case for the given type (only URGENT/SMALL/LARGE are valid for pings), so the default branch throws. Note the message uses string concatenation '+ type' rather than formatting — a minor bug producing 'Unsupported type: + type' text. Reached via deserialize of a ping request with a corrupt/unsupported connection type.
Solutions
- Upgrade the receiving node so it recognizes the new MessageCategory
- If you added a category, add a case (and pool) for it in PingRequest.get()
- Check cluster version alignment before pinging across versions
Example fix
// before
case SMALL_MESSAGES: return forSmall;
default: throw new IllegalArgumentException("Unsupported type: " + type);
// after
case SMALL_MESSAGES: return forSmall;
case NEW_CATEGORY: return forNew; // added for the new MessageCategory
default: throw new IllegalArgumentException("Unsupported type: " + type); Defensive patterns
Strategy: try-catch
Try / catch
try { pool = PingRequest.get(category); } catch (IllegalArgumentException e) { log.warn("Unsupported ping category {}, dropping", category, e); /* drop ping */ } Prevention
- Align cluster versions before rolling upgrades
- Update all switches over MessageCategory when adding a new one
- Never hand-craft ping messages with unknown categories
When it happens
Trigger: Calling PingRequest.get(type) with a category outside URGENT_MESSAGES/SMALL_MESSAGES/LARGE_MESSAGES, e.g. from serializer.deserialize() when a future/new category is sent by a peer running a newer version.
Common situations: Rolling upgrades where a newer node sends a ping with a category the older node does not know; accidental addition of a new MessageCategory without updating this switch.
Related errors
- Invalid custom verb id + id + - we only allow custom ids…
- Invalid IP address ( . . . ) while deserializing inet…
- Invalid IP address while deserializing inet address
- Invalid verb id + id + - we only allow ids between 0 and…
- ParamType id must be non-negative (got + id + )
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/1994e179fd8dd0b2.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/net/PingRequest.java:56
static final PingRequest forSmall = new PingRequest(SMALL_MESSAGES);
static final PingRequest forLarge = new PingRequest(LARGE_MESSAGES);
final ConnectionType connectionType;
private PingRequest(ConnectionType connectionType)
{
this.connectionType = connectionType;
}
@VisibleForTesting
public static PingRequest get(ConnectionType type)
{
switch (type)
{
case URGENT_MESSAGES: return forUrgent;
case SMALL_MESSAGES: return forSmall;
case LARGE_MESSAGES: return forLarge;
default: throw new IllegalArgumentException("Unsupported type: " + type);
}
}
static IVersionedSerializer<PingRequest> serializer = new IVersionedSerializer<PingRequest>()
{
public void serialize(PingRequest t, DataOutputPlus out, int version) throws IOException
{
out.writeByte(t.connectionType.id);
}
public PingRequest deserialize(DataInputPlus in, int version) throws IOException
{
return get(ConnectionType.fromId(in.readByte()));
}
public long serializedSize(PingRequest t, int version)
{
return 1;View on GitHub (pinned to 88fd0f6a0e)