{"record":{"id":"75b7de7fd1a55020","repo":"apache/beam","slug":"failed-to-marshal-window-coder-v","errorCode":null,"errorMessage":"failed to marshal window coder %v","messagePattern":"failed to marshal window coder (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/coder.go","lineNumber":520,"sourceCode":"\n\t\t// SDKs always provide iterableCoder to runners, but can receive StateBackedIterables in return.\n\t\tstream := b.internBuiltInCoder(urnIterableCoder, value)\n\t\treturn b.internBuiltInCoder(urnKVCoder, comp[0], stream), nil\n\n\tcase coder.ShardedKey:\n\t\tcomp, err := b.AddMulti(c.Components)\n\t\tif err != nil {\n\t\t\treturn \"\", errors.Wrapf(err, \"failed to marshal ShardedKey coder %v\", c)\n\t\t}\n\t\tif len(comp) != 1 {\n\t\t\treturn \"\", errors.Errorf(\"ShardedKey coder requires exactly 1 component (key), got %d\", len(comp))\n\t\t}\n\t\treturn b.internBuiltInCoder(urnShardedKeyCoder, comp...), nil\n\n\tcase coder.WindowedValue:\n\t\tcomp := []string{}\n\t\tif ids, err := b.AddMulti(c.Components); err != nil {\n\t\t\treturn \"\", errors.Wrapf(err, \"failed to marshal window coder %v\", c)\n\t\t} else {\n\t\t\tcomp = append(comp, ids...)\n\t\t}\n\t\tif id, err := b.AddWindowCoder(c.Window); err != nil {\n\t\t\treturn \"\", errors.Wrapf(err, \"failed to marshal window coder %v\", c)\n\t\t} else {\n\t\t\tcomp = append(comp, id)\n\t\t}\n\t\treturn b.internBuiltInCoder(urnWindowedValueCoder, comp...), nil\n\n\tcase coder.Bytes:\n\t\t// TODO(herohde) 6/27/2017: add length-prefix and not assume nested by context?\n\t\treturn b.internBuiltInCoder(urnBytesCoder), nil\n\n\tcase coder.Bool:\n\t\treturn b.internBuiltInCoder(urnBoolCoder), nil\n\n\tcase coder.VarInt:","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/coder.go#L502-L538","documentation":"Wraps failure of AddMulti when marshalling the element components of a coder.WindowedValue coder (the first wrap call of two in that case). The windowed-value wrapper needs its value components serialized before the window coder; a failing component produces this error.","triggerScenarios":"CoderBuilder.Add on a coder.WindowedValue whose element components fail AddMulti.","commonSituations":"Windowed PCollections over unregistered custom types; failures originating in nested component coders.","solutions":["Inspect the wrapped error for the failing component coder","Register the element types with beam.RegisterType before beam.Init","Verify windowing setup only uses supported window kinds","Upgrade the SDK if the component kind is new"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Distinguish the two wrapped stages by unwrapping\nif err != nil && strings.Contains(err.Error(), \"failed to marshal window coder\") {\n    log.Printf(\"windowed value component failure: %v\", errors.Unwrap(err))\n}","preventionTips":["Register all windowed element types before beam.Init","Test windowed pipeline construction locally","Keep element coder kinds within supported set"],"tags":["beam","go","coder","windowing"],"backgroundTag":"json-marshal-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"}