{"record":{"id":"9eaa5d04a92fd754","repo":"apache/beam","slug":"prism-error-building-stage-v-w","errorCode":null,"errorMessage":"prism error building stage %v: \n%w","messagePattern":"prism error building stage (.+?): \n%w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/execute.go","lineNumber":323,"sourceCode":"\t\t\t\t\t\t\ttsb.AddProcessingTimeEvent(time.Duration(mtime.MaxTimestamp))\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttsb.AddProcessingTimeEvent(time.Duration(ev.ProcessingTimeEvent.GetAdvanceDuration()) * time.Millisecond)\n\t\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn fmt.Errorf(\"prism error building stage %v - unknown TestStream event type: %T\", stage.ID, ev)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tcase urns.TransformFlatten:\n\t\t\t\tinputs := maps.Values(t.GetInputs())\n\t\t\t\tsort.Strings(inputs)\n\t\t\t\tem.AddStage(stage.ID, inputs, []string{getOnlyValue(t.GetOutputs())}, nil)\n\t\t\t}\n\t\t\tstages[stage.ID] = stage\n\t\tcase wk.Env:\n\t\t\tif err := buildDescriptor(stage, comps, wk, em); err != nil {\n\t\t\t\treturn fmt.Errorf(\"prism error building stage %v: \\n%w\", stage.ID, err)\n\t\t\t}\n\t\t\tstages[stage.ID] = stage\n\t\t\toutputs := maps.Keys(stage.OutputsToCoders)\n\t\t\tsort.Strings(outputs)\n\t\t\tem.AddStage(stage.ID, []string{stage.primaryInput}, outputs, stage.sideInputs)\n\t\t\tif stage.stateful {\n\t\t\t\tem.StageStateful(stage.ID, stage.stateTypeLen)\n\t\t\t}\n\t\t\tif stage.onWindowExpiration.TimerFamily != \"\" {\n\t\t\t\tslog.Debug(\"OnWindowExpiration\", slog.String(\"stage\", stage.ID), slog.Any(\"values\", stage.onWindowExpiration))\n\t\t\t\tem.StageOnWindowExpiration(stage.ID, stage.onWindowExpiration)\n\t\t\t}\n\t\t\tif len(stage.processingTimeTimers) > 0 {\n\t\t\t\tem.StageProcessingTimeTimers(stage.ID, stage.processingTimeTimers)\n\t\t\t}\n\t\t\tstage.sdfSplittable = config.EnableSDFSplit\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown environment[%v]\", t.GetEnvironmentId())","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/execute.go#L305-L341","documentation":"This error wraps a failure from buildDescriptor when executePipeline processes a worker-environment (wk.Env) element of the pipeline. buildDescriptor assembles the bundle descriptor / environment configuration for the stage; any error it returns (missing environment config, bad coders, failed container setup data) is wrapped with the stage ID and the underlying cause via %w. It is the prism runner's stage-construction failure point for environment-backed transforms.","triggerScenarios":"Calling RunPipeline on a pipeline whose stages include an environment (Docker/external/loopback) transform, and buildDescriptor fails — e.g. the referenced environment config is missing or malformed, or the stage's coders/descriptors cannot be built.","commonSituations":"Cross-language pipelines whose environment config was not provisioned; malformed pipeline protobufs; SDK/proto version mismatches leaving the environment definition incomplete in the model.","solutions":["Read the wrapped (%w) inner error in the message — it names the concrete buildDescriptor failure.","Verify the environment config referenced by the stage is valid and complete in the submitted pipeline proto.","Ensure SDK harness/container images and prism runner versions are compatible."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Validate environment configs exist in the pipeline proto before submission\nfor id, env := range comps.GetEnvironments() {\n    if env.GetUrn() == \"\" { log.Fatalf(\"environment %q has empty URN\", id) }\n}","typeGuard":null,"tryCatchPattern":"if err := beamx.Run(ctx, p); err != nil {\n    if strings.Contains(err.Error(), \"prism error building stage\") {\n        log.Fatalf(\"stage build failed: %+v\", err) // unwrap %w chain with errors.Unwrap\n    }\n    return err\n}","preventionTips":["Keep harness/container images in sync with the prism version","Validate cross-language environment registration before submission","Unwrap the error chain to read the buildDescriptor root cause"],"tags":["go","beam","prism-runner","stage-build"],"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-14T11:17:12.474Z"}