apache/beam · error · IllegalArgumentException
Unexpected type_info: +protoFieldType.getTypeInfoCase()
Error message
Unexpected type_info: +protoFieldType.getTypeInfoCase()
What it means
When converting a proto FieldType back into a Beam schema FieldType, the code switches over the proto's type_info oneof case. If the case is neither LOGICAL_TYPE, ATOMIC_TYPE, ARRAY_TYPE, ITERABLE_TYPE, MAP_TYPE, nor ROW_TYPE, the default branch throws this IllegalArgumentException because the wire data contains a type_info variant this Beam version does not understand.
Source
Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/SchemaTranslation.java:508
LOG.debug("Constructing non-standard logical type {} as UnknownLogicalType", urn);
}
}
// assemble an UnknownLogicalType
@Nullable FieldType argumentType = null;
@Nullable Object argumentValue = null;
if (logicalType.hasArgumentType()) {
argumentType = fieldTypeFromProto(logicalType.getArgumentType());
argumentValue = fieldValueFromProto(argumentType, logicalType.getArgument());
}
return FieldType.logicalType(
new UnknownLogicalType(
urn,
logicalType.getPayload().toByteArray(),
argumentType,
argumentValue,
fieldTypeFromProto(logicalType.getRepresentation())));
default:
throw new IllegalArgumentException(
"Unexpected type_info: " + protoFieldType.getTypeInfoCase());
}
}
private static void overrideEncodingPositions(Schema schema) {
@javax.annotation.Nullable UUID uuid = schema.getUUID();
if (schema.isEncodingPositionsOverridden() && uuid != null) {
RowCoder.overrideEncodingPositions(uuid, schema.getEncodingPositions());
}
schema.getFields().stream()
.map(Schema.Field::getType)
.forEach(SchemaTranslation::overrideEncodingPositions);
}
private static void overrideEncodingPositions(Schema.FieldType fieldType) {
switch (fieldType.getTypeName()) {
case ROW:
overrideEncodingPositions(View on GitHub (pinned to 12126d8942)
Solutions
- Align Beam SDK versions so the reader is at least as new as the writer that produced the proto.
- Inspect getTypeInfoCase() in a debugger/logs to see the unexpected case; check the schema proto for a newly added variant.
- Re-serialize the data with the older Beam version if downgrade is required.
- Regenerate/redeploy from a build that includes the schema-proto version containing that type_info case.
Example fix
// before Beam 2.54 reader decoding schema written by Beam 2.60 with a new type_info case // after upgrade reader dependency: org.apache.beam:beam-sdks-java-core to >= writer version
Defensive patterns
Strategy: validation
Validate before calling
if (protoFieldType.getTypeInfoCase() == SchemaApi.FieldType.TypeInfoCase.TYPEINFO_NOT_SET || protoFieldType.getTypeInfoCase().name().equals("UNRECOGNIZED")) { throw new IllegalStateException("unknown type_info case; reader Beam version too old for this data"); } Try / catch
try { decodeSchema(bytes); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Unexpected type_info:")) { /* upgrade SDK or re-serialize */ } else { throw e; } } Prevention
- Keep Beam SDK versions uniform across writer and reader
- Never hand-build schema protos; use SchemaTranslation APIs
- Test cross-version deserialization when upgrading Beam
When it happens
Trigger: fieldTypeFromProtoWithoutNullable receives a SchemaApi.FieldType whose getTypeInfoCase() is UNRECOGNIZED or from a newer Beam proto (added enum case) while the runtime Beam version is older — i.e. schema written by a newer Beam, read by an older Beam.
Common situations: Version skew: pipeline serialized with a newer Beam SDK/schema proto, deserialized with an older SDK; corrupted or hand-crafted proto FieldValue messages; a case added upstream that the local build predates.
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
- Unknown ValueKind number: {}
- Could not decode bytes as message
- Encountered unknown AtomicType: +protoFieldType.getAtomicTyp
- Unable to infer data schema from configuration proto.
- Could not parse Pub/Sub message
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/fc2ce6d03d68cd3e.
Report an issue: GitHub.