{"record":{"id":"463dc7bcc59134e0","repo":"apache/beam","slug":"failed-to-start-environment-v-for-job-v-w","errorCode":null,"errorMessage":"failed to start environment %v for job %v: %w","messagePattern":"failed to start environment (.+?) for job (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/execute.go","lineNumber":58,"sourceCode":"\n// RunPipeline starts the main thread fo executing this job.\n// It's analoguous to the manager side process for a distributed pipeline.\n// It will begin \"workers\"\nfunc RunPipeline(j *jobservices.Job) {\n\tj.SendMsg(\"starting \" + j.String())\n\tj.Start()\n\n\t// In a \"proper\" runner, we'd iterate through all the\n\t// environments, and start up docker containers, but\n\t// here, we only want and need the go one, operating\n\t// in loopback mode.\n\tenvs := j.Pipeline.GetComponents().GetEnvironments()\n\twks := map[string]*worker.W{}\n\tfor envID := range envs {\n\t\twk := j.MakeWorker(envID)\n\t\twks[envID] = wk\n\t\tif err := runEnvironment(j.RootCtx, j, envID, wk); err != nil {\n\t\t\tj.Failed(fmt.Errorf(\"failed to start environment %v for job %v: %w\", envID, j, err))\n\t\t\treturn\n\t\t}\n\t\t// Check for connection succeeding after we've created the environment successfully.\n\t\ttimeout := 1 * time.Minute\n\t\ttime.AfterFunc(timeout, func() {\n\t\t\tif wk.Connected() || wk.Stopped() {\n\t\t\t\treturn\n\t\t\t}\n\t\t\terr := fmt.Errorf(\"prism %v didn't get control connection to %v after %v\", wk, wk.Endpoint(), timeout)\n\t\t\tj.Failed(err)\n\t\t\tj.CancelFn(err)\n\t\t})\n\t}\n\n\t// When this function exits, we cancel the context to clear\n\t// any related job resources.\n\tdefer func() {\n\t\tj.CancelFn(fmt.Errorf(\"runPipeline returned, cleaning up\"))","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/execute.go#L40-L76","documentation":"RunPipeline starts every environment of the job via runEnvironment. If any environment fails to start, the job is marked Failed with this wrapper error carrying the environment ID, job, and the underlying cause (e.g. docker or process launch failure).","triggerScenarios":"Any error returned by runEnvironment for any envID — docker connect/create/start failure, unimplemented environment URN, or process launch failure.","commonSituations":"Docker unavailable on the runner host, bad container image, or unsupported environment type in the submitted pipeline.","solutions":["Read the wrapped cause (%w) to identify the environment startup failure","Verify Docker/process prerequisites before launching prism","Fix the pipeline environment config (image, URN) as indicated by the cause","Retry after environment fixes; check worker logs for details"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-flight: docker reachable + image present\ncheckDocker(); checkImage(sdkImage)","typeGuard":null,"tryCatchPattern":"if err := j.WaitUntilDone(ctx); err != nil {\n  if strings.Contains(err.Error(), \"failed to start environment\") {\n    log.Fatalf(\"environment startup failed: %v\", err)\n  }\n}","preventionTips":["Run pre-flight environment checks before submitting pipelines","Read the wrapped cause before retrying"],"tags":["go","beam","prism-runner","environment","job-startup"],"backgroundTag":"api-error-response","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"}