{"record":{"id":"ce94a82b006283ec","repo":"apache/beam","slug":"could-not-unmarshal-stream-type-coder-from-v-stream-must-be","errorCode":null,"errorMessage":"could not unmarshal stream type coder from %v, stream must be pair value","messagePattern":"could not unmarshal stream type coder from (.+?), stream must be pair value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/coder.go","lineNumber":324,"sourceCode":"\t\telm, err := b.Coder(components[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tw, err := b.WindowCoder(components[1])\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"could not unmarshal window coder: %w\", err)\n\t\t}\n\t\tt := typex.New(typex.WindowedValueType, elm.T)\n\t\twvc := &coder.Coder{Kind: coder.WindowedValue, T: t, Components: []*coder.Coder{elm}, Window: w}\n\t\tif urn == urnWindowedValueCoder {\n\t\t\treturn wvc, nil\n\t\t}\n\t\twvc.Kind = coder.ParamWindowedValue\n\t\twvc.Window.Payload = string(c.GetSpec().GetPayload())\n\t\treturn wvc, nil\n\n\tcase streamType:\n\t\treturn nil, errors.Errorf(\"could not unmarshal stream type coder from %v, stream must be pair value\", c)\n\n\tcase \"\":\n\t\t// TODO(herohde) 11/27/2017: we still see CoderRefs from Dataflow. Handle that\n\t\t// case here, for now, so that the harness can use this logic.\n\n\t\tpayload := c.GetSpec().GetPayload()\n\n\t\tvar ref CoderRef\n\t\tif err := json.Unmarshal(payload, &ref); err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"could not unmarshal CoderRef from %v, failed to decode urn-less coder's payload \\\"%v\\\"\", c, string(payload))\n\t\t}\n\t\tc, err := DecodeCoderRef(&ref)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"could not unmarshal CoderRef from %v, failed to decode CoderRef \\\"%v\\\"\", c, string(payload))\n\t\t}\n\t\treturn c, nil\n\n\tcase urnIterableCoder, urnStateBackedIterableCoder:","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/coder.go#L306-L342","documentation":"makeCoder encountered a pipelineb.Coder whose URN is the (internal) stream type but whose structure is not the required pair-value shape, so it cannot be converted into a Beam coder. This URN is only valid as a component inside a pair coder; a bare stream-type coder is a protocol violation.","triggerScenarios":"Decoding a CoderRef/pipeline protobuf where a coder component uses the stream-type URN directly instead of nested under a pair coder.","commonSituations":"Graphs produced by non-Go runners or legacy Dataflow CoderRefs leaking through; hand-crafted pipeline JSON; SDK version mismatches producing stale coder encodings.","solutions":["Inspect the serialized coder: the stream URN must appear only as a component of a pair coder","Re-generate the pipeline with the Go SDK so coders are encoded with supported URNs","Upgrade/align SDK versions on both producer and consumer sides","If from Dataflow legacy refs, use the modern model pipeline representation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if ref.Urn == streamTypeURN {\n    return errors.New(\"stream type coder must be nested in a pair coder\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never reference the stream-type URN directly in coder components","Generate pipelines only through the Go SDK APIs","Validate serialized CoderRef structure before job submission"],"tags":["go","apache-beam","coder","serialization"],"backgroundTag":"invalid-argument-format","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"}