{"record":{"id":"7ae3aecc15f568de","repo":"apache/beam","slug":"bad-window-v","errorCode":null,"errorMessage":"bad window: %v","messagePattern":"bad window: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/dataflow.go","lineNumber":408,"sourceCode":"\tcase coder.GlobalWindow:\n\t\treturn &CoderRef{Type: globalWindowType}, nil\n\tcase coder.IntervalWindow:\n\t\treturn &CoderRef{Type: intervalWindowType}, nil\n\tdefault:\n\t\treturn nil, errors.Errorf(\"bad window kind: %v\", w.Kind)\n\t}\n}\n\n// decodeWindowCoder receives the wire representation of a Beam coder, extracting\n// the preprocessed representation, expanding all types used by the coder.\nfunc decodeWindowCoder(w *CoderRef) (*coder.WindowCoder, error) {\n\tswitch w.Type {\n\tcase globalWindowType:\n\t\treturn coder.NewGlobalWindow(), nil\n\tcase intervalWindowType:\n\t\treturn coder.NewIntervalWindow(), nil\n\tdefault:\n\t\treturn nil, errors.Errorf(\"bad window: %v\", w.Type)\n\t}\n}\n","sourceCodeStart":390,"sourceCodeEnd":411,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/dataflow.go#L390-L411","documentation":"decodeWindowCoder maps a wire CoderRef back to a WindowCoder. The ref's Type must be one of the two known window type markers (globalWindowType or intervalWindowType); anything else is rejected because the window representation is unknown to graphx.","triggerScenarios":"DecodeCoderRef encounters a windowed coder ref whose Type URL does not match globalWindowType or intervalWindowType — typically a ref produced by a different Beam version or a foreign runner.","commonSituations":"Deserializing pipelines saved by a newer/older Beam release; cross-version job submission (e.g. runner built with different SDK); corrupted or externally rewritten pipeline JSON.","solutions":["Use the same Beam Go SDK version to serialize and deserialize the pipeline.","Re-serialize the pipeline with a supported windowing strategy (global or interval).","Inspect the CoderRef.Type in the pipeline spec to identify which window type string is unexpected and map it to a supported one."],"exampleFix":"// before: window type from newer SDK\nCoderRef{Type: &protobuf.Type{...}}\n// after: pin SDK versions\n// go.mod: require github.com/apache/beam/sdks/v2 vX.Y.Z  (same as job submitter)","handlingStrategy":"validation","validationCode":"if w.Type == nil || (w.Type.String() != globalWindowType.String() && w.Type.String() != intervalWindowType.String()) {\n    return errors.New(\"unknown window coder type\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"bad window:\") {\n        // check SDK version parity before re-decoding\n    }\n}","preventionTips":["Pin Beam SDK version across pipeline save and load","Re-save old pipeline specs with the current SDK before reuse"],"tags":["go","beam","windowing","deserialization"],"backgroundTag":"unsupported-operation","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"}