{"record":{"id":"42a3ca0aa266ac27","repo":"apache/beam","slug":"attempted-to-add-namespace-to-missing-windowing-strategy-id","errorCode":null,"errorMessage":"attempted to add namespace to missing windowing strategy id: %v not in %v","messagePattern":"attempted to add namespace to missing windowing strategy id: (.+?) not in (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"sdks/go/pkg/beam/core/runtime/xlangx/namespace.go","lineNumber":62,"sourceCode":"\t}\n\n\tidMap[cid] = newID(cid)\n\n\t// Updating Coders map\n\tc.Coders[idMap[cid]] = coder\n\tdelete(c.Coders, cid)\n\n\treturn idMap[cid]\n}\n\nfunc addWindowingStrategyID(c *pipepb.Components, idMap map[string]string, wid string, newID func(string) string) string {\n\tif _, exists := idMap[wid]; exists {\n\t\treturn idMap[wid]\n\t}\n\n\twindowingStrategy, exists := c.WindowingStrategies[wid]\n\tif !exists {\n\t\tpanic(errors.Errorf(\"attempted to add namespace to missing windowing strategy id: %v not in %v\", wid, c.WindowingStrategies))\n\t}\n\n\t// Updating WindowCoderID of WindowingStrategy\n\tif windowingStrategy.WindowCoderId != \"\" {\n\t\twindowingStrategy.WindowCoderId = addCoderID(c, idMap, windowingStrategy.WindowCoderId, newID)\n\t}\n\n\tidMap[wid] = newID(wid)\n\n\t// Updating WindowingStrategies map\n\tc.WindowingStrategies[idMap[wid]] = windowingStrategy\n\tdelete(c.WindowingStrategies, wid)\n\n\treturn idMap[wid]\n}\n\nfunc addNamespace(t *pipepb.PTransform, c *pipepb.Components, namespace string) {\n\tnewID := func(id string) string {","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/xlangx/namespace.go#L44-L80","documentation":"addWindowingStrategyID rewrites a windowing strategy's references under a new namespace during cross-language expansion. This panic fires when the windowing strategy ID referenced in the pipeline's Components is missing from Components.WindowingStrategies — a dangling reference in the pipeline proto. Like its coder counterpart it is an internal invariant panic.","triggerScenarios":"xlangx.Expand / addNamespace processing a pipeline whose transform or coder references a WindowingStrategyId never registered in Components.WindowingStrategies; manually mutated pipeline protos; expansion responses missing windowing strategy entries.","commonSituations":"Cross-language expansion with windowed P collections across SDK boundaries; custom runner code that reconstructs pipeline components; Beam version skew where IDs are not carried across expansion correctly.","solutions":["Verify every WindowingStrategyId referenced by coders/transforms exists in Components.WindowingStrategies before calling Expand.","Use the official Beam pipeline-construction APIs so windowing strategies are registered automatically.","Align Beam SDK versions across language SDKs and re-run the expansion job.","Report a runner/SDK bug if a standard pipeline (built via beam.Pipeline) hits this panic."],"exampleFix":"// before: pipeline proto hand-copied without windowing strategies\npipe.Components.WindowingStrategies = map[string]*pipepb.WindowingStrategy{}\n\n// after: keep the full component set from the deserialized pipeline\npipe, _ := pipelinepb.FromJSON(pipelineJSON) // includes windowing strategies","handlingStrategy":"validation","validationCode":"for _, c := range pipe.Components.Coders {\n    if wid := c.GetWindowCoderId(); wid != \"\" {\n        if _, ok := pipe.Components.WindowingStrategies[wid]; !ok {\n            return fmt.Errorf(\"dangling windowing strategy id %q\", wid)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Register windowing strategies via standard pipeline construction (beam.WindowInto) so IDs are always present.","Verify complete pipeline JSON round-trips before expansion.","Match Beam SDK versions across language SDKs in cross-language jobs."],"tags":["go","apache-beam","cross-language","windowing","panic"],"backgroundTag":"internal-invariant-violation","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"}