{"record":{"id":"2d2514d5461a30e5","repo":"apache/beam","slug":"unrecognized-state-type-v","errorCode":null,"errorMessage":"Unrecognized state type %v","messagePattern":"Unrecognized state type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/translate.go","lineNumber":569,"sourceCode":"\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t_, fn, _, _, _, err := graphx.DecodeMultiEdge(cmbTp.GetEdge())\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcfn, err := graph.AsCombineFn(fn)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstateIDToCombineFn[key] = cfn\n\t\t\t\t\t\t\t} else if ms := spec.GetMapSpec(); ms != nil {\n\t\t\t\t\t\t\t\tcID = ms.ValueCoderId\n\t\t\t\t\t\t\t\tkcID = ms.KeyCoderId\n\t\t\t\t\t\t\t} else if ss := spec.GetSetSpec(); ss != nil {\n\t\t\t\t\t\t\t\tkcID = ss.ElementCoderId\n\t\t\t\t\t\t\t} else if ols := spec.GetOrderedListSpec(); ols != nil {\n\t\t\t\t\t\t\t\tcID = ols.ElementCoderId\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn nil, errors.Errorf(\"Unrecognized state type %v\", spec)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif cID != \"\" {\n\t\t\t\t\t\t\t\tc, err := b.coders.Coder(cID)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstateIDToCoder[key] = c\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// If no value coder is provided, we are in a keyed state with no values (aka a set).\n\t\t\t\t\t\t\t\t// We represent a set as an element mapping to a bool representing if it is present or not.\n\t\t\t\t\t\t\t\tstateIDToCoder[key] = &coder.Coder{Kind: coder.Bool}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif kcID != \"\" {\n\t\t\t\t\t\t\t\tkc, err := b.coders.Coder(kcID)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstateIDToKeyCoder[key] = kc","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/translate.go#L551-L587","documentation":"makeLink enumerates a ParDo's user-state specs (ReadModifyWrite, Bag, Combining, Map, Set, OrderedList) when reconstructing execution units. If a state spec is none of these, the decoder cannot interpret the state type and fails with 'Unrecognized state type'.","triggerScenarios":"A UserState spec in the pipeline protobuf with all spec oneof fields empty or set to a newer/unknown state type (e.g. a state kind this SDK version doesn't know), typically when a newer pipeline is run against an older SDK harness.","commonSituations":"Version skew between pipeline builder and Go FnAPI harness; a custom runner emitting unpopulated StateSpec protos; hand-crafted pipeline graphs.","solutions":["Upgrade the Go Beam SDK harness to match (or exceed) the version that built the pipeline","Check the spec oneof: ensure exactly one of ReadModifyWriteSpec/BagSpec/CombiningSpec/MapSpec/SetSpec/OrderedListSpec is set","Re-encode the pipeline with the Go SDK instead of hand-building the StateSpec protobuf"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"func stateSpecKnown(spec *pipepb.StateSpec) error {\n\tswitch {\n\tcase spec.GetReadModifyWriteSpec() != nil, spec.GetBagSpec() != nil,\n\t\tspec.GetCombiningSpec() != nil, spec.GetMapSpec() != nil,\n\t\tspec.GetSetSpec() != nil, spec.GetOrderedListSpec() != nil:\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unsupported state spec: %v\", spec)\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Use only user-state kinds supported by your Go SDK version","Keep harness and pipeline-builder versions in sync before submitting","Test stateful pipelines with the exact container image used in production"],"tags":["go","apache-beam","state-api","pipeline-translation"],"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"}