{"record":{"id":"7546ae732936631a","repo":"apache/beam","slug":"could-not-unmarshal-global-window-coder-w","errorCode":null,"errorMessage":"could not unmarshal global window coder: %w","messagePattern":"could not unmarshal global window coder: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/coder.go","lineNumber":403,"sourceCode":"\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\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 {","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/coder.go#L385-L421","documentation":"When decoding a global-window coder reference, makeCoder re-derives the window coder via b.WindowCoder(id) and failed; the underlying decode error is wrapped with this message. It means the global window reference cannot be resolved in the current components context.","triggerScenarios":"Decoding beam:coder:global_window:v1 where the window lookup by ID fails — missing or invalid window component reference in the coder components map.","commonSituations":"Corrupted or hand-edited pipeline components; SDK version skew; window coder IDs referencing entries dropped during graph transformation.","solutions":["Check the wrapped cause for why b.WindowCoder(id) failed (missing ID, bad payload)","Regenerate the pipeline graph with the Go SDK","Verify the coder's component references point to valid window coder entries","Align SDK versions between producer and harness"],"exampleFix":"// before: global window coder referencing a dropped component ID\n// after: re-export the pipeline so the window coder component is present, e.g. {\"urn\":\"beam:coder:global_window:v1\",\"components\":[]}","handlingStrategy":"try-catch","validationCode":"// ensure the window coder ID resolves in the components table before decoding\nif _, err := b.WindowCoder(ref.ID); err != nil {\n    return fmt.Errorf(\"window coder %q unresolvable: %w\", ref.ID, err)\n}","typeGuard":null,"tryCatchPattern":"c, err := graphx.Coder(model, ref)\nif err != nil {\n    if strings.Contains(err.Error(), \"global window coder\") {\n        return fmt.Errorf(\"window components missing from pipeline model: %w\", err)\n    }\n    return err\n}","preventionTips":["Never drop window coder components during graph transforms","Validate component ID references before decode","Use the SDK to build pipelines, not hand-written JSON"],"tags":["go","apache-beam","coder","windowing"],"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-14T16:17:12.679Z"}