{"record":{"id":"ad50d8507e646ac5","repo":"apache/beam","slug":"panic-in-stage-execute-bundle-processing-goroutine-v-stage-v","errorCode":null,"errorMessage":"panic in stage.Execute bundle processing goroutine: %v, stage: %+v,stackTrace:\n%s","messagePattern":"panic in stage\\.Execute bundle processing goroutine: (.+?), stage: %\\+v,stackTrace:\n(.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/stage.go","lineNumber":132,"sourceCode":"\tfor k, v := range s.OutputsToCoders {\n\t\toutAttrs = append(outAttrs, slog.Any(k, v))\n\t}\n\treturn slog.GroupValue(\n\t\tslog.String(\"ID\", s.ID),\n\t\tslog.Any(\"transforms\", s.transforms),\n\t\tslog.Any(\"inputInfo\", s.inputInfo),\n\t\tslog.Group(\"outputInfo\", outAttrs...),\n\t)\n}\n\nfunc (s *stage) Execute(ctx context.Context, j *jobservices.Job, wk *worker.W, comps *pipepb.Components, em *engine.ElementManager, rb engine.RunBundle) (err error) {\n\tif s.baseProgTick.Load() == nil {\n\t\ts.baseProgTick.Store(minimumProgTick)\n\t}\n\tdefer func() {\n\t\t// Convert execution panics to errors to fail the bundle.\n\t\tif e := recover(); e != nil {\n\t\t\terr = fmt.Errorf(\"panic in stage.Execute bundle processing goroutine: %v, stage: %+v,stackTrace:\\n%s\", e, s, debug.Stack())\n\t\t}\n\t}()\n\tslog.Debug(\"Execute: starting bundle\", \"bundle\", rb)\n\n\tvar b *worker.B\n\tinitialState := em.StateForBundle(rb)\n\tvar dataReady <-chan struct{}\n\tswitch s.envID {\n\tcase \"\": // Runner Transforms\n\t\tif len(s.transforms) != 1 {\n\t\t\tpanic(fmt.Sprintf(\"unexpected number of runner transforms, want 1: %+v\", s))\n\t\t}\n\t\ttid := s.transforms[0]\n\t\t// Runner transforms are processed immeadiately.\n\t\tb = s.exe.ExecuteTransform(s.ID, tid, comps.GetTransforms()[tid], comps, rb.Watermark, em.InputForBundle(rb, s.inputInfo))\n\t\tb.InstID = rb.BundleID\n\t\tslog.Debug(\"Execute: runner transform\", \"bundle\", rb, slog.String(\"tid\", tid))\n","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/stage.go#L114-L150","documentation":"stage.Execute recovers any panic that occurs in the bundle-processing goroutine and converts it into this error including the panic value, the stage, and a stack trace. The bundle fails (rather than crashing the whole runner process) so the job can report the failure.","triggerScenarios":"Any panic inside bundle execution for a stage — nil dereference in prism's bundle processing, a bad coder causing index panics, or unrecovered panics from internal state handling.","commonSituations":"Processing unexpected data that triggers unbounded assumptions; concurrent state access bugs; runner bugs around timers/state on new SDK features.","solutions":["Read the included stackTrace to locate the panicking prism code","Reproduce with the specific bundle data captured in logs","File a Beam issue with the full stack trace if the panic originates in prism","Pin to a Beam version where the panic is fixed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := stage.Execute(ctx, wk, comps, s, rb); err != nil {\n    if strings.HasPrefix(err.Error(), \"panic in stage.Execute\") {\n        slog.Error(\"stage panic\", \"stack\", extractStack(err))\n    }\n    return err\n}","preventionTips":["Capture full bundle inputs when a panic occurs for reproduction","Keep prism at a patched Beam release","Report panics with stack traces to the Beam project"],"tags":["go","panic","beam","runner"],"backgroundTag":"recovered-panic","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"}