apache/beam · error

resp.Error

Error message

resp.Error

What it means

The Beam Go harness state manager returns this error when a state response from the runner contains a non-empty Error field, meaning the runner rejected the state request (Get/Set/Append/Clear on a state channel). The raw runner-side error message is surfaced verbatim via errors.New(resp.Error).

Solutions

  1. Read the embedded resp.Error message for the runner-side root cause and fix that on the runner/backend side
  2. Retry the pipeline; transient runner/backend state failures often resolve on re-run
  3. Check runner-specific state backend configuration (e.g. Flink state backend, Dataflow worker state) for capacity/connectivity issues
  4. Upgrade Beam to a version with your runner's latest state-service fixes
Defensive patterns

Strategy: try-catch

Validate before calling

// check state channel health before sending
if c == nil || c.closedErr != nil { return fmt.Errorf("state channel closed") }
select {
case <-c.DoneCh:
    return fmt.Errorf("state channel already canceled")
default:
}

Try / catch

resp, err := sm.Get(ctx, req)
if err != nil {
    if strings.Contains(err.Error(), "StateChannel") { /* channel-level failure: retry or recreate */ }
    return fmt.Errorf("state request failed: %w", err)
}

Prevention

When it happens

Trigger: Calling state APIs (cache Get/Set/Append/Clear via c.Send) over a StateChannel where the runner side responds with an ErrorResponse instead of a payload.

Common situations: Runner-side state backend failures during side-input/materialized-bundle processing on Flink/Spark/Dataflow runners; multiharness cross-language jobs where state backing store is unavailable or the bag/iterable was evicted.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/ab9b4609fbfc31ca. Report an issue: GitHub.

Appendix: source

Thrown at sdks/go/pkg/beam/core/runtime/harness/statemgr.go:802

	if c.closedErr != nil {
		defer c.mu.Unlock()
		return nil, errors.Wrapf(c.closedErr, "StateChannel[%v].Send(%v): channel closed due to: %v", c.id, id, c.closedErr)
	}
	c.responses[id] = ch
	c.mu.Unlock()

	c.requests <- req

	var resp *fnpb.StateResponse
	select {
	case resp = <-ch:
	case <-c.DoneCh:
		c.mu.Lock()
		defer c.mu.Unlock()
		return nil, errors.Wrapf(c.closedErr, "StateChannel[%v].Send(%v): context canceled", c.id, id)
	}
	if resp.Error != "" {
		return nil, errors.New(resp.Error)
	}
	return resp, nil
}

View on GitHub (pinned to 12126d8942)