{"record":{"id":"6fb3066b4ee7220e","repo":"apache/beam","slug":"could-not-unmarshal-nullable-coder-from-v-expected-one","errorCode":null,"errorMessage":"could not unmarshal nullable coder from %v, expected one component but got %d","messagePattern":"could not unmarshal nullable coder from (.+?), expected one component but got (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/coder.go","lineNumber":376,"sourceCode":"\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 for timer: %w\", err)\n\t\t}\n\t\treturn coder.NewT(elm, w), nil\n\tcase urnRowCoder:\n\t\tvar s pipepb.Schema\n\t\tif err := proto.Unmarshal(c.GetSpec().GetPayload(), &s); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tt, err := schema.ToType(&s)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn coder.NewR(typex.New(t)), nil\n\tcase urnNullableCoder:\n\t\tif len(components) != 1 {\n\t\t\treturn nil, errors.Errorf(\"could not unmarshal nullable 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.NewN(elm), nil\n\tcase urnShardedKeyCoder:\n\t\tif len(components) != 1 {\n\t\t\treturn nil, errors.Errorf(\"could not unmarshal sharded_key coder from %v, expected one component (key) but got %d\", c, len(components))\n\t\t}\n\t\tkeyC, err := b.Coder(components[0])\n\t\tif err != nil {\n\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","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/coder.go#L358-L394","documentation":"Error returned by makeCoder when a nullable coder URN arrives with a component count other than one. Nullable wraps exactly one inner element coder; any other arity indicates a malformed CoderRef in the pipeline proto or a version skew between producer and consumer of the pipeline.","triggerScenarios":"Decoding a nullable coder whose components list is empty or has more than one entry.","commonSituations":"Hand-edited pipeline JSON; graphs generated by SDK versions before nullable coder support; corrupted job artifacts.","solutions":["Ensure the nullable coder nests exactly one element coder component","Regenerate the pipeline with a current Go SDK","Fix hand-written CoderRef JSON to include one component","Check SDK version skew if a foreign producer wrote the coder"],"exampleFix":"// before: nullable coder with 0 components\n// after: {\"urn\":\"beam:coder:nullable:v1\",\"components\":[{\"urn\":\"beam:coder:string_utf8:v1\",\"components\":[]}]}","handlingStrategy":"validation","validationCode":"if ref.Urn == \"beam:coder:nullable:v1\" && len(ref.Components) != 1 {\n    return fmt.Errorf(\"nullable coder must have exactly 1 component, got %d\", len(ref.Components))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate pipelines after SDK upgrades","Do not hand-edit coder JSON","Verify component arity for every custom URN you emit"],"tags":["go","apache-beam","coder","validation"],"backgroundTag":"missing-required-argument","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"}