{"record":{"id":"d097afaf91975020","repo":"apache/beam","slug":"could-not-unmarshal-coder-from-v-unknown-urn-v","errorCode":null,"errorMessage":"could not unmarshal coder from %v, unknown URN %v","messagePattern":"could not unmarshal coder from (.+?), unknown URN (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/coder.go","lineNumber":407,"sourceCode":"\t\t\treturn nil, err\n\t\t}\n\t\treturn coder.NewSK(keyC), nil\n\tcase urnIntervalWindow:\n\t\treturn coder.NewIntervalWindowCoder(), nil\n\n\t// Special handling for the global window coder so it can be treated as\n\t// a general coder. Generally window coders are not used outside of\n\t// specific contexts, but this enables improved testing.\n\t// Window types are not permitted to be fulltypes, so\n\t// we use assignably equivalent anonymous struct types.\n\tcase urnGlobalWindow:\n\t\tw, err := b.WindowCoder(id)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Errorf(\"could not unmarshal global window coder: %w\", err)\n\t\t}\n\t\treturn &coder.Coder{Kind: coder.Window, T: typex.New(reflect.TypeOf((*struct{})(nil)).Elem()), Window: w}, nil\n\tdefault:\n\t\treturn nil, errors.Errorf(\"could not unmarshal coder from %v, unknown URN %v\", c, urn)\n\t}\n}\n\nfunc (b *CoderUnmarshaller) peek(id string) (*pipepb.Coder, error) {\n\tc, ok := b.models[id]\n\tif !ok {\n\t\treturn nil, errors.Errorf(\"(peek) coder with id %v not found\", id)\n\t}\n\treturn c, nil\n}\n\nfunc (b *CoderUnmarshaller) isCoGBKList(id string) ([]string, bool) {\n\telm, err := b.peek(id)\n\tif err != nil {\n\t\treturn nil, false\n\t}\n\tif elm.GetSpec().GetUrn() != urnLengthPrefixCoder {\n\t\treturn nil, false","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/coder.go#L389-L425","documentation":"During pipeline deserialization, graphx.makeCoder saw a coder FunctionSpec whose URN is not among the known Beam coder URNs. This happens when the serialized pipeline contains a coder kind the Go SDK's CoderUnmarshaller does not recognize (unsupported coder kind, cross-language coder, or newer Beam coder URN). The unmarshal aborts and the pipeline fails to decode.","triggerScenarios":"Deserializing a pipeline model (e.g. from a job submission or JSON/proto graph) whose coder spec has an unrecognized URN; unmarshalling a graph written by a newer Beam SDK or another SDK with coder kinds the Go runtime doesn't map.","commonSituations":"Cross-language pipeline portability (Python/Java writes a coder the Go SDK lacks); version skew where the runner serialized a coder URN introduced after the local Go SDK version; hand-edited or corrupted pipeline JSON.","solutions":["Upgrade the Go Beam SDK to the same or newer version that produced the pipeline so the URN is recognized","Check which URN is printed in the error and confirm it is a supported coder kind in sdks/go/pkg/beam/core/runtime/graphx/coder.go","If the pipeline uses a custom coder, ensure it was registered with beam.RegisterType on the Go side before deserialization","Avoid mixing SDK versions between pipeline construction and deserialization/runner"],"exampleFix":"// before: decoding a pipeline built by a newer SDK with an unrecognized coder URN\n// after: upgrade the SDK\n// go.mod\nrequire github.com/apache/beam/sdks/v2 v2.xx.0 // bump to >= version that wrote the graph\nbeam.Init() // then re-run pipeline decode","handlingStrategy":"try-catch","validationCode":"// Before decoding, verify the producing SDK version matches your Go SDK\n// e.g. log the pipeline's beam_version and compare with sdk version","typeGuard":null,"tryCatchPattern":"// err contains \"unknown URN\" -> log urn from message and check\n// supported URNs in graphx before retrying with an upgraded SDK\nif err != nil && strings.Contains(err.Error(), \"unknown URN\") {\n    // fail fast with a clear upgrade hint\n}","preventionTips":["Keep the Go SDK version >= the version that serialized the pipeline","Avoid hand-editing pipeline JSON/proto models","Register all custom types before beam.Init"],"tags":["beam","go","pipeline-deserialization","coder"],"backgroundTag":"protobuf-unmarshal-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}