{"record":{"id":"8354bd44c0fb6d6c","repo":"apache/beam","slug":"unknown-environment-v","errorCode":null,"errorMessage":"unknown environment[%v]","messagePattern":"unknown environment\\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/execute.go","lineNumber":341,"sourceCode":"\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())\n\t\t}\n\t}\n\n\t// Prime the initial impulses, since we now know what consumes them.\n\tfor _, id := range impulses {\n\t\tem.Impulse(id)\n\t}\n\n\t// Use an errgroup to limit max parallelism for the pipeline.\n\teg, egctx := errgroup.WithContext(ctx)\n\teg.SetLimit(8)\n\n\tvar instID uint64\n\tbundles := em.Bundles(egctx, j.CancelFn, func() string {\n\t\treturn fmt.Sprintf(\"inst%03d\", atomic.AddUint64(&instID, 1))\n\t})\n\n\t// Create a new ticker that fires every 60 seconds.","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/execute.go#L323-L359","documentation":"executePipeline iterates pipeline components and handles each as a PTransform, environment (wk.Env), etc. If a component's environment ID does not correspond to any environment handled (it falls into the default case), the runner rejects the pipeline with 'unknown environment[<id>]'. This is a defensive check against pipeline protos referencing environments prism cannot interpret.","triggerScenarios":"Submitting a pipeline whose transform's GetEnvironmentId() references an environment ID absent from, or unregistered in, the pipeline's components map.","commonSituations":"Hand-crafted or partially deserialized pipeline protos; cross-language pipelines where the environment registry entry was dropped; SDK emitting a new environment kind an older prism doesn't recognize.","solutions":["Check the pipeline proto's environments list — the referenced environment ID must exist in components.GetEnvironments().","Regenerate the pipeline graph with a current SDK version so environments are emitted correctly.","For cross-language jobs, confirm the expansion service registered the environment before submission."],"exampleFix":"// before (pipeline proto missing the env entry)\ntransform.environment_id = \"env-42\" // not in environments\n\n// after\n// include env-42 in pipeline.components.environments before submitting","handlingStrategy":"validation","validationCode":"// Ensure every transform's environment ID resolves before submitting\nenvs := comps.GetEnvironments()\nfor _, t := range comps.GetTransforms() {\n    if id := t.GetEnvironmentId(); id != \"\" {\n        if _, ok := envs[id]; !ok {\n            log.Fatalf(\"transform %q references unknown environment %q\", t.GetUniqueName(), id)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := beamx.Run(ctx, p); err != nil && strings.Contains(err.Error(), \"unknown environment\") {\n    log.Fatalf(\"pipeline references an unregistered environment: %v\", err)\n}","preventionTips":["Generate pipeline graphs with the SDK rather than hand-editing protos","Register cross-language environments via the expansion service before submission","Keep SDK and prism versions aligned"],"tags":["go","beam","prism-runner","pipeline-model"],"backgroundTag":"entity-not-found","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"}