{"record":{"id":"95380ced9e1be983","repo":"apache/beam","slug":"could-not-unmarshal-window-coder-w","errorCode":null,"errorMessage":"could not unmarshal window coder: %w","messagePattern":"could not unmarshal window coder: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/coder.go","lineNumber":167,"sourceCode":"\tret, err := b.makeCoder(id, c)\n\tif err != nil {\n\t\treturn nil, errors.WithContextf(err, \"unmarshalling coder %v\", id)\n\t}\n\tret.ID = id\n\n\tb.coders[id] = ret\n\treturn ret, nil\n}\n\n// WindowCoder unmarshals a window coder with the given id.\nfunc (b *CoderUnmarshaller) WindowCoder(id string) (*coder.WindowCoder, error) {\n\tif w, exists := b.windowCoders[id]; exists {\n\t\treturn w, nil\n\t}\n\n\tc, err := b.peek(id)\n\tif err != nil {\n\t\treturn nil, errors.Errorf(\"could not unmarshal window coder: %w\", err)\n\t}\n\n\tw, err := urnToWindowCoder(c.GetSpec().GetUrn())\n\tif err != nil {\n\t\treturn nil, errors.SetTopLevelMsgf(err, \"failed to unmarshal window coder %v\", id)\n\t}\n\tb.windowCoders[id] = w\n\treturn w, nil\n}\n\nfunc urnToWindowCoder(urn string) (*coder.WindowCoder, error) {\n\tswitch urn {\n\tcase urnGlobalWindow:\n\t\treturn coder.NewGlobalWindow(), nil\n\tcase urnIntervalWindow:\n\t\treturn coder.NewIntervalWindow(), nil\n\tdefault:\n\t\terr := errors.Errorf(\"unexpected URN %v for window coder\", urn)","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/coder.go#L149-L185","documentation":"CoderUnmarshaller.WindowCoder resolves the window coder for a given ID by peeking at the raw coder proto. If peeking (which recursively unmarshals) fails, the error is wrapped as \"could not unmarshal window coder: %w\". It indicates a failure while decoding the windowing coder portion of a PCollection.","triggerScenarios":"makeCoderForPCollection or makeCoder resolving a windowed PCollection's window coder when the underlying component coder fails to peek/unmarshal (missing component, bad coder ID, unsupported nested coder).","commonSituations":"Corrupted or incomplete pipeline protos; coder component IDs referencing nonexistent coders; cross-version pipeline serialization where nested coder payloads changed format.","solutions":["Inspect the wrapped cause (%w) — it usually points to a missing or invalid component coder.","Ensure all component coder IDs referenced by the window coder exist in the pipeline proto.","Re-marshal the pipeline with a matching SDK version if it was produced by a different Beam release.","If hand-crafting windowed coders, verify the coder spec URN and payload are valid."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"w, err := um.WindowCoder(id)\nif err != nil && strings.Contains(err.Error(), \"could not unmarshal window coder\") {\n    log.Printf(\"inspect wrapped cause and fix component coders: %v\", err)\n}","preventionTips":["Ensure all component coders referenced by window coders are present in the proto.","Avoid cross-version pipeline serialization without re-marshaling.","Round-trip test pipelines (marshal then unmarshal) in CI."],"tags":["go","coder","windowing","unmarshaling"],"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"}