{"record":{"id":"1ed7839f914d6628","repo":"apache/beam","slug":"could-not-unmarshal-coderref-from-v-failed-to-decode","errorCode":null,"errorMessage":"could not unmarshal CoderRef from %v, failed to decode CoderRef \"%v\"","messagePattern":"could not unmarshal CoderRef from (.+?), failed to decode CoderRef \"(.+?)\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/coder.go","lineNumber":338,"sourceCode":"\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:\n\t\tif len(components) != 1 {\n\t\t\treturn nil, errors.Errorf(\"could not unmarshal iterable coder from %v, expected one component but got %d\", c, len(components))\n\t\t}\n\t\telm, err := b.Coder(components[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn coder.NewI(elm), nil\n\tcase urnTimerCoder:\n\t\tif len(components) != 2 {\n\t\t\treturn nil, errors.Errorf(\"could not unmarshal timer coder from %v, expected two component but got %d\", c, len(components))\n\t\t}\n\t\telm, err := b.Coder(components[0])\n\t\tif err != nil {","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/coder.go#L320-L356","documentation":"The urn-less coder's payload parsed as JSON but DecodeCoderRef rejected it — the CoderRef contents (URN or components) do not map to any known coder. Wrapped with this message so both the raw payload and cause are visible.","triggerScenarios":"json.Unmarshal of the payload succeeded but the CoderRef contains an unsupported/unknown URN or malformed component list passed to DecodeCoderRef.","commonSituations":"CoderRefs referencing custom coders not registered on the decoding side; SDK version skew where newer coder URNs are unknown; typos in hand-written CoderRef JSON.","solutions":["Check the wrapped cause from DecodeCoderRef for the unknown URN","Register custom coder URNs via coder.CustomCoder and graphx custom coder handling on both ends","Align SDK versions between graph producer and decoder","Fix the CoderRef JSON payload fields (urn, components)"],"exampleFix":"// before: CoderRef with unknown urn \"my:coder:v9\"\n// after: use a supported urn or register a custom coder, e.g. {\"urn\":\"beam:coder:bytes:v1\",\"components\":[]}","handlingStrategy":"try-catch","validationCode":"// check URN is one DecodeCoderRef understands before decoding\nswitch ref.Urn {\ncase \"\", \"beam:coder:bytes:v1\", \"beam:coder:kv:v1\", \"beam:coder:iterable:v1\":\n    // ok\ndefault:\n    return fmt.Errorf(\"unsupported coder URN %q\", ref.Urn)\n}","typeGuard":null,"tryCatchPattern":"c, err := graphx.Coder(model, ref)\nif err != nil {\n    return fmt.Errorf(\"unsupported CoderRef %q: %w\", payload, err)\n}","preventionTips":["Register custom coders on both encoding and decoding sides","Avoid SDK version skew between stages that share coders","Lint CoderRef JSON for known URNs before 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"}