{"record":{"id":"875ec235a84e2d8a","repo":"apache/beam","slug":"unable-to-marshal-windowing-strategy-for-pcol-v-w","errorCode":null,"errorMessage":"unable to marshal windowing strategy for PCol %v: %w","messagePattern":"unable to marshal windowing strategy for PCol (.+?): %w","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/xlangx/registry.go","lineNumber":112,"sourceCode":"}\n\n// ID produces a standard format globally namespaced id for a PCollection from the local identifier.\nfunc (p *PCol) ID() string {\n\treturn fmt.Sprintf(\"n%v@%v\", p.Local, p.namespace)\n}\n\n// WSID produces a standard format globally namespaced id for a WindowingStrategy from the local identifier.\nfunc (p *PCol) WSID() string {\n\treturn fmt.Sprintf(\"ws%v@%v\", p.Local, p.namespace)\n}\n\n// WindowingStrategy returns the id to this PCollection's windowing strategy, and the associated proto.\n//\n// TODO: intern windowing strategies.\nfunc (p *PCol) WindowingStrategy(cm *graphx.CoderMarshaller) (string, *pipepb.WindowingStrategy) {\n\twspb, err := graphx.MarshalWindowingStrategy(cm, p.node.WindowingStrategy())\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"unable to marshal windowing strategy for PCol %v: %w\", p.Local, err))\n\t}\n\treturn p.WSID(), wspb\n}\n\nfunc makePCol(node *graph.Node, index int, local, namespace string) PCol {\n\treturn PCol{\n\t\tIndex:   index,\n\t\tLocal:   local,\n\t\tCoder:   node.Coder,\n\t\tBounded: pipelinex.BoolToBounded(node.Bounded()),\n\n\t\tnamespace: namespace,\n\t\tnode:      node,\n\t}\n}\n\n// Outputs returns the provided output PCollections, if any, for expected outputs\n// for this expansion service request.","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/xlangx/registry.go#L94-L130","documentation":"PCol.WindowingStrategy marshals a PCollection's windowing strategy to a proto for cross-language pipeline serialization. If graphx.MarshalWindowingStrategy fails, this panic fires with the PCollection's local name and the underlying error. It indicates an internal marshaling failure, typically from an unsupported or corrupt windowing strategy, not user input validation.","triggerScenarios":"Building a cross-language pipeline whose PCollection has a windowing strategy graphx cannot marshal (unknown/unsupported window fn or cusum arguments failing proto encoding), reached via the expansion/translation path.","commonSituations":"Custom windowing functions not supported by the proto schema; pipelines crossing Go SDK boundaries with exotic windowing configurations; version skew between SDK components introducing unmarshalable strategies.","solutions":["Use standard windowing (fixed, sliding, session, global) supported by Beam's proto schema.","Check the wrapped error (%v of err) for the exact marshal failure cause.","If a custom window fn is required, implement proto-serialization support or file an issue upstream.","Verify all SDKs in the cross-language pipeline are compatible versions."],"exampleFix":"// before\nw := beam.WindowInto(s, window.NewCustomWindowFn(...), col) // custom fn unmarshalable\n// after\nw := beam.WindowInto(s, window.NewFixedWindows(60*time.Second), col)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        err = fmt.Errorf(\"windowing strategy marshaling failed: %v\", r)\n    }\n}()","preventionTips":["Stick to built-in Beam windowing functions for cross-language pipelines","Upgrade/match SDK versions across language SDKs","Read the wrapped cause in the panic message before changing pipeline code"],"tags":["go","windowing","serialization","panic"],"backgroundTag":"schema-validation-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"}