{"record":{"id":"ed328a3c90b4b29a","repo":"apache/beam","slug":"invalid-status-for-combine-extract-v-v","errorCode":null,"errorMessage":"invalid status for combine extract %v: %v","messagePattern":"invalid status for combine extract (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/combine.go","lineNumber":633,"sourceCode":"\t\treturn err\n\t}\n\tn.optimizeMergeFn()\n\treturn nil\n}\n\n// ExtractOutput is an executor for extracting output from a lifted combine.\ntype ExtractOutput struct {\n\t*Combine\n}\n\nfunc (n *ExtractOutput) String() string {\n\treturn fmt.Sprintf(\"ExtractOutput[%v] Keyed:%v Out:%v\", path.Base(n.Fn.Name()), n.UsesKey, n.Out.ID())\n}\n\n// ProcessElement accepts an accumulator value, and extracts the final return type from it.\nfunc (n *ExtractOutput) ProcessElement(ctx context.Context, value *FullValue, values ...ReStream) error {\n\tif n.status != Active {\n\t\treturn errors.Errorf(\"invalid status for combine extract %v: %v\", n.UID, n.status)\n\t}\n\tn.Combine.states.Set(n.Combine.ctx, metrics.StartBundle)\n\tout, err := n.extract(n.Combine.ctx, value.Elm2)\n\tif err != nil {\n\t\treturn n.fail(err)\n\t}\n\treturn n.Out.ProcessElement(n.Combine.ctx, &FullValue{Windows: value.Windows, Elm: value.Elm, Elm2: out, Timestamp: value.Timestamp})\n}\n\n// ConvertToAccumulators is an executor for converting an input value to an accumulator value.\ntype ConvertToAccumulators struct {\n\t*Combine\n}\n\nfunc (n *ConvertToAccumulators) String() string {\n\treturn fmt.Sprintf(\"ConvertToAccumulators[%v] Keyed:%v Out:%v\", path.Base(n.Fn.Name()), n.UsesKey, n.Out.ID())\n}\n","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/combine.go#L615-L651","documentation":"ExtractOutput.ProcessElement (which extracts final results from accumulators) requires the node to be Active inside a started bundle. Any other status means ProcessElement was called outside the expected lifecycle phase.","triggerScenarios":"Calling ExtractOutput.ProcessElement before StartBundle or after FinishBundle.","commonSituations":"Direct unit invocation in tests; runner bugs where extraction is triggered outside bundle execution.","solutions":["Drive the lifecycle: Up, StartBundle, ProcessElement, FinishBundle.","Verify StartBundle returned nil error before emitting accumulator values.","Construct a fresh ExtractOutput node if reuse across bundles is needed without proper state resets."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := extract.ProcessElement(ctx, fv, values); err != nil {\n\tif strings.Contains(err.Error(), \"invalid status for combine extract\") {\n\t\t// ensure extract node is inside an active bundle\n\t}\n\treturn err\n}","preventionTips":["Keep extract nodes within the enclosing plan's bundle lifecycle.","Do not invoke extraction outside ProcessElement flow.","Assert lifecycle order in unit tests with a mock Downstream."],"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"}