apache/beam · error
invalid status for combine extract %v: %v
Error message
invalid status for combine extract %v: %v
What it means
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.
Source
Thrown at sdks/go/pkg/beam/core/runtime/exec/combine.go:633
return err
}
n.optimizeMergeFn()
return nil
}
// ExtractOutput is an executor for extracting output from a lifted combine.
type ExtractOutput struct {
*Combine
}
func (n *ExtractOutput) String() string {
return fmt.Sprintf("ExtractOutput[%v] Keyed:%v Out:%v", path.Base(n.Fn.Name()), n.UsesKey, n.Out.ID())
}
// ProcessElement accepts an accumulator value, and extracts the final return type from it.
func (n *ExtractOutput) ProcessElement(ctx context.Context, value *FullValue, values ...ReStream) error {
if n.status != Active {
return errors.Errorf("invalid status for combine extract %v: %v", n.UID, n.status)
}
n.Combine.states.Set(n.Combine.ctx, metrics.StartBundle)
out, err := n.extract(n.Combine.ctx, value.Elm2)
if err != nil {
return n.fail(err)
}
return n.Out.ProcessElement(n.Combine.ctx, &FullValue{Windows: value.Windows, Elm: value.Elm, Elm2: out, Timestamp: value.Timestamp})
}
// ConvertToAccumulators is an executor for converting an input value to an accumulator value.
type ConvertToAccumulators struct {
*Combine
}
func (n *ConvertToAccumulators) String() string {
return fmt.Sprintf("ConvertToAccumulators[%v] Keyed:%v Out:%v", path.Base(n.Fn.Name()), n.UsesKey, n.Out.ID())
}
View on GitHub (pinned to 12126d8942)
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.
Defensive patterns
Strategy: validation
Try / catch
if err := extract.ProcessElement(ctx, fv, values); err != nil {
if strings.Contains(err.Error(), "invalid status for combine extract") {
// ensure extract node is inside an active bundle
}
return err
} Prevention
- 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.
When it happens
Trigger: Calling ExtractOutput.ProcessElement before StartBundle or after FinishBundle.
Common situations: Direct unit invocation in tests; runner bugs where extraction is triggered outside bundle execution.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- invalid status for precombine %v: %v
- invalid status for combine merge %v: %v
- invalid status for combine convert %v: %v
- invalid status for combine %v: %v
- unable to infer CombineFn accumulator coder
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/ed328a3c90b4b29a.
Report an issue: GitHub.