{"record":{"id":"d402ebbac61b464e","repo":"apache/beam","slug":"bad-window-kind-v","errorCode":null,"errorMessage":"bad window kind: %v","messagePattern":"bad window kind: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/dataflow.go","lineNumber":395,"sourceCode":"\t}\n\tref2 := ref.Components[0]\n\tif ref2.Type != cogbklistType {\n\t\treturn nil, false\n\t}\n\treturn ref2.Components, true\n}\n\n// encodeWindowCoder translates the preprocessed representation of a Beam coder\n// into the wire representation, capturing the underlying types used by\n// the coder.\nfunc encodeWindowCoder(w *coder.WindowCoder) (*CoderRef, error) {\n\tswitch w.Kind {\n\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":377,"sourceCodeEnd":411,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/dataflow.go#L377-L411","documentation":"encodeWindowCoder converts a beam WindowCoder into its wire CoderRef representation, but only GlobalWindows and IntervalWindows have defined encodings. Any other window kind (e.g. a session or custom window kind) has no Dataflow wire mapping, so encoding fails.","triggerScenarios":"Calling graphx.EncodeCoderRef or WrapWindowed with a WindowCoder whose Kind is neither GlobalWindow nor IntervalWindow.","commonSituations":"Using custom windowing in a pipeline submitted to a runner that only supports global/interval windows; window coder produced by a newer SDK with kinds this version cannot serialize.","solutions":["Restrict the pipeline to global windows or fixed/interval (sliding) windows supported by the target runner.","Upgrade the SDK/runner to a version that supports the window kind in graphx encoding.","Convert custom windowing to a supported windowing strategy before serialization."],"exampleFix":"// before: custom window kind\npc := beam.WindowInto(s, myCustomWindowing, col)\n// after\npc := beam.WindowInto(s, window.NewFixedWindows(60*time.Second), col)","handlingStrategy":"validation","validationCode":"switch wc.Kind {\ncase coder.GlobalWindow, coder.IntervalWindow:\n    // safe to encode\ndefault:\n    return errors.New(\"window kind not supported by runner\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"bad window kind\") {\n        // re-window the pipeline with fixed/global windows\n    }\n}","preventionTips":["Use global or fixed/interval windows unless the runner supports more","Verify custom windowing compatibility with the target runner before submit"],"tags":["go","beam","windowing","coder"],"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"}