{"record":{"id":"1ec46c1fcc0a5954","repo":"apache/beam","slug":"while-executing-up-for-v","errorCode":null,"errorMessage":"while executing Up for %v","messagePattern":"while executing Up for (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/plan.go","lineNumber":127,"sourceCode":"// ID returns the plan identifier.\nfunc (p *Plan) ID() string {\n\treturn p.id\n}\n\n// SourcePTransformID returns the ID of the data's origin PTransform.\nfunc (p *Plan) SourcePTransformID() string {\n\treturn p.source.SID.PtransformID\n}\n\n// Execute executes the plan with the given data context and bundle id. Units\n// are brought up on the first execution. If a bundle fails, the plan cannot\n// be reused for further bundles. Does not panic. Blocking.\nfunc (p *Plan) Execute(ctx context.Context, id string, manager DataContext) error {\n\tif p.getStatus() == Initializing {\n\t\tfor _, u := range p.units {\n\t\t\tif err := callNoPanic(ctx, u.Up); err != nil {\n\t\t\t\tp.setStatus(Broken)\n\t\t\t\treturn errors.Wrapf(err, \"while executing Up for %v\", p)\n\t\t\t}\n\t\t}\n\t\tp.setStatus(Up)\n\t}\n\tif p.source != nil {\n\t\tp.source.InitSplittable()\n\t}\n\n\tif s := p.getStatus(); s != Up {\n\t\treturn errors.Errorf(\"invalid status for plan %v: %v\", p.id, s)\n\t}\n\n\t// Process bundle. If there are any kinds of failures, we bail and mark the plan broken.\n\n\tp.setStatus(Active)\n\tfor _, root := range p.roots {\n\t\tif err := callNoPanic(ctx, func(ctx context.Context) error { return root.StartBundle(ctx, id, manager) }); err != nil {\n\t\t\tp.setStatus(Broken)","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/plan.go#L109-L145","documentation":"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).","triggerScenarios":"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.","commonSituations":"DoFn setup hooks (SetUp) failing on bad configuration; stale generated shims; nil units or misconfigured transforms surfaced during first bundle execution.","solutions":["Read the wrapped cause (errors.Unwrap or %v of the chain) to find which unit failed and why.","Fix the underlying unit error - commonly DoFn SetUp failures or emitter interface issues (regenerate shims).","Rebuild the plan after fixing: a Broken plan cannot be reused."],"exampleFix":"// before\nif err := plan.Execute(ctx, id, mgr); err != nil { return err }\n// after\nif err := plan.Execute(ctx, id, mgr); err != nil {\n    log.Printf(\"plan init failed: %v\", err) // inspect wrapped cause\n    plan, err = constructAndExecutePlanWithContext(ctx, ...) // fresh plan\n    return err\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := plan.Execute(ctx, id, mgr); err != nil {\n    var cause error\n    for errors.Unwrap(err) != nil {\n        cause = errors.Unwrap(err)\n    }\n    log.Printf(\"plan Up failed, root cause: %v\", cause)\n    return err\n}","preventionTips":["Inspect the wrapped cause; this error is always secondary to a unit-level failure.","Validate DoFn SetUp logic (external clients, config) before running pipelines.","Regenerate shims after SDK upgrades to avoid emitter interface failures during Up.","Rebuild plans after Up failures; they are marked Broken."],"tags":["go","apache-beam","initialization","wrapped-error"],"backgroundTag":"internal-invariant-violation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}