apache/beam · error

while executing Up for

Error message

while executing Up for %v

What it means

Plan.Execute runs Up on every unit when the plan is Initializing; if any unit's Up returns an error the plan is marked Broken and this wrapped error is returned, adding context about which plan failed. It is a wrapper around an underlying unit initialization error (e.g. the ParDo.Up error 5000, DoFn setup failures, side-input validation).

Solutions

  1. Read the wrapped cause (errors.Unwrap or %v of the chain) to find which unit failed and why.
  2. Fix the underlying unit error - commonly DoFn SetUp failures or emitter interface issues (regenerate shims).
  3. Rebuild the plan after fixing: a Broken plan cannot be reused.

Example fix

// before
if err := plan.Execute(ctx, id, mgr); err != nil { return err }
// after
if err := plan.Execute(ctx, id, mgr); err != nil {
    log.Printf("plan init failed: %v", err) // inspect wrapped cause
    plan, err = constructAndExecutePlanWithContext(ctx, ...) // fresh plan
    return err
}
Defensive patterns

Strategy: try-catch

Try / catch

if err := plan.Execute(ctx, id, mgr); err != nil {
    var cause error
    for errors.Unwrap(err) != nil {
        cause = errors.Unwrap(err)
    }
    log.Printf("plan Up failed, root cause: %v", cause)
    return err
}

Prevention

When it happens

Trigger: Any unit in the plan failing Up: DoFn setup returning an error, invalid emitter (error 5004), status violations, or panics converted to errors by callNoPanic.

Common situations: DoFn setup hooks (SetUp) failing on bad configuration; stale generated shims; nil units or misconfigured transforms surfaced during first bundle execution.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at sdks/go/pkg/beam/core/runtime/exec/plan.go:127

// ID returns the plan identifier.
func (p *Plan) ID() string {
	return p.id
}

// SourcePTransformID returns the ID of the data's origin PTransform.
func (p *Plan) SourcePTransformID() string {
	return p.source.SID.PtransformID
}

// Execute executes the plan with the given data context and bundle id. Units
// are brought up on the first execution. If a bundle fails, the plan cannot
// be reused for further bundles. Does not panic. Blocking.
func (p *Plan) Execute(ctx context.Context, id string, manager DataContext) error {
	if p.getStatus() == Initializing {
		for _, u := range p.units {
			if err := callNoPanic(ctx, u.Up); err != nil {
				p.setStatus(Broken)
				return errors.Wrapf(err, "while executing Up for %v", p)
			}
		}
		p.setStatus(Up)
	}
	if p.source != nil {
		p.source.InitSplittable()
	}

	if s := p.getStatus(); s != Up {
		return errors.Errorf("invalid status for plan %v: %v", p.id, s)
	}

	// Process bundle. If there are any kinds of failures, we bail and mark the plan broken.

	p.setStatus(Active)
	for _, root := range p.roots {
		if err := callNoPanic(ctx, func(ctx context.Context) error { return root.StartBundle(ctx, id, manager) }); err != nil {
			p.setStatus(Broken)

View on GitHub (pinned to 12126d8942)