{"record":{"id":"fd9032e4880139d6","repo":"apache/beam","slug":"unknown-valuekind-proto","errorCode":null,"errorMessage":"Unknown ValueKind: <proto>","messagePattern":"Unknown ValueKind: <proto>","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/values/ValueKindUtil.java","lineNumber":51,"sourceCode":"        return Elements.ValueKind.Enum.DELETE;\n      default:\n        throw new IllegalArgumentException(\"Unknown ValueKind: \" + valueKind);\n    }\n  }\n\n  public static ValueKind fromProto(Elements.ValueKind.Enum proto) {\n    switch (proto) {\n      case VALUE_KIND_UNSPECIFIED:\n      case INSERT:\n        return ValueKind.INSERT;\n      case UPDATE_BEFORE:\n        return ValueKind.UPDATE_BEFORE;\n      case UPDATE_AFTER:\n        return ValueKind.UPDATE_AFTER;\n      case DELETE:\n        return ValueKind.DELETE;\n      default:\n        throw new IllegalArgumentException(\"Unknown ValueKind: \" + proto);\n    }\n  }\n}\n","sourceCodeStart":33,"sourceCodeEnd":55,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/values/ValueKindUtil.java#L33-L55","documentation":"ValueKindUtil.fromProto converts a protobuf Elements.ValueKind.Enum back to the in-memory ValueKind; the default branch throws IllegalArgumentException when the proto enum value has no mapping. This occurs for VALUE_KIND_UNSPECIFIED or proto constants the installed SDK's switch does not know (version skew between writer and reader).","triggerScenarios":"Calling ValueKindUtil.fromProto(proto) with VALUE_KIND_UNSPECIFIED, or with a proto constant added by a newer Beam version than the one running this switch.","commonSituations":"Reading pipeline graph/Elements protos produced by a different Beam version; protos serialized with unspecified kind fields; hand-crafted protos in tests.","solutions":["Upgrade the Beam SDK so fromProto handles all proto constants your data may contain","Handle VALUE_KIND_UNSPECIFIED upstream (skip or default) before calling fromProto","Regenerate/normalize protos with a matching Beam version instead of mixing versions"],"exampleFix":"// before\nValueKind k = ValueKindUtil.fromProto(proto); // proto == VALUE_KIND_UNSPECIFIED\n// after\nValueKind k = (proto == Elements.ValueKind.Enum.VALUE_KIND_UNSPECIFIED) ? ValueKind.VALUE : ValueKindUtil.fromProto(proto);","handlingStrategy":"try-catch","validationCode":"if (proto == Elements.ValueKind.Enum.VALUE_KIND_UNSPECIFIED) { proto = Elements.ValueKind.Enum.VALUE; }","typeGuard":null,"tryCatchPattern":"try { kind = ValueKindUtil.fromProto(proto); } catch (IllegalArgumentException e) { log.warn(\"unknown proto kind\", e); kind = ValueKind.VALUE; }","preventionTips":["Ensure protos are produced and consumed by the same Beam version","Normalize unspecified kinds before conversion","Handle new enum constants when upgrading SDKs"],"tags":["java","apache-beam","enum","protobuf"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}