{"record":{"id":"1d310e9e42d10f84","repo":"apache/beam","slug":"invalid-status-for-precombine-v-v","errorCode":null,"errorMessage":"invalid status for precombine %v: %v","messagePattern":"invalid status for precombine (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/combine.go","lineNumber":362,"sourceCode":"\tn.cache = newLiftingCache(cacheMax, n.KeyCoder, n.WindowCoder)\n\treturn nil\n}\n\n// StartBundle initializes the in memory cache of keys to accumulators.\nfunc (n *LiftedCombine) StartBundle(ctx context.Context, id string, data DataContext) error {\n\tif err := n.Combine.StartBundle(ctx, id, data); err != nil {\n\t\treturn err\n\t}\n\tn.cache.start()\n\treturn nil\n}\n\n// ProcessElement takes a KV pair and combines values with the same key into an accumulator,\n// caching them until the bundle is complete. If the cache grows too large, a random eviction\n// policy is used.\nfunc (n *LiftedCombine) ProcessElement(ctx context.Context, value *FullValue, values ...ReStream) error {\n\tif n.status != Active {\n\t\treturn errors.Errorf(\"invalid status for precombine %v: %v\", n.UID, n.status)\n\t}\n\n\tn.Combine.states.Set(n.Combine.ctx, metrics.ProcessBundle)\n\n\t// The cache layer in lifted combines implicitly observes windows. Process each individually.\n\tfor _, w := range value.Windows {\n\t\terr := n.processElementPerWindow(ctx, value, w)\n\t\tif err != nil {\n\t\t\treturn n.fail(err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (n *LiftedCombine) processElementPerWindow(ctx context.Context, value *FullValue, w typex.Window) error {\n\tkey, afv, notfirst, err := n.cache.lookup(value, w)\n\tif err != nil {\n\t\treturn n.fail(err)","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/combine.go#L344-L380","documentation":"LiftedCombine.ProcessElement (the precombine/lifted path) requires the node status to be Active, i.e., inside a started bundle. Processing elements outside an active bundle violates the lifecycle and returns this error.","triggerScenarios":"Calling LiftedCombine.ProcessElement before StartBundle or after FinishBundle.","commonSituations":"Custom runners or tests invoking the lifted-combine unit directly without driving Up/StartBundle first.","solutions":["Drive the full lifecycle: Up, StartBundle, ProcessElement, FinishBundle.","Restart the bundle (StartBundle) if elements must be processed after FinishBundle.","Verify the plan executor isn't reusing a finished unit."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := lifted.ProcessElement(ctx, fv); err != nil {\n\tif strings.Contains(err.Error(), \"invalid status for precombine\") {\n\t\t// ensure StartBundle was called on the lifted combine\n\t}\n\treturn err\n}","preventionTips":["Drive lifted combines through the plan executor lifecycle only.","Never emit elements before StartBundle or after FinishBundle.","Rebuild the unit if it must be reused across bundles."],"tags":["go","beam","lifecycle","state-machine","combine"],"backgroundTag":"invalid-state-transition","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"}