{"record":{"id":"8de7435669ce7135","repo":"apache/beam","slug":"presulterr-error-execute","errorCode":null,"errorMessage":"presultErr.Error()","messagePattern":"presultErr\\.Error\\(\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/universal/runnerlib/execute.go","lineNumber":114,"sourceCode":"\n\tjobID, err := Submit(ctx, client, prepID, token)\n\tif err != nil {\n\t\treturn presult, err\n\t}\n\n\tlog.Infof(ctx, \"Submitted job: %v\", jobID)\n\n\t// (4) Wait for completion.\n\n\tif async {\n\t\treturn presult, nil\n\t}\n\terr = WaitForCompletion(ctx, client, jobID)\n\n\tres, presultErr := newUniversalPipelineResult(ctx, jobID, client, p)\n\tif presultErr != nil {\n\t\tif err != nil {\n\t\t\treturn presult, errors.Wrap(err, presultErr.Error())\n\t\t}\n\t\treturn presult, presultErr\n\t}\n\treturn res, err\n}\n\n// UpdateGoEnvironmentWorker sets the worker artifact payload in\n// the default environment.\nfunc UpdateGoEnvironmentWorker(worker string, p *pipepb.Pipeline) error {\n\tfd, err := os.Open(worker)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fd.Close()\n\n\tsha256W := sha256.New()\n\tn, err := io.Copy(sha256W, fd)\n\tif err != nil {","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/universal/runnerlib/execute.go#L96-L132","documentation":"After waiting for a job to finish on a universal (remote) runner, Execute builds the final pipeline result. If constructing that result fails (presultErr != nil) while the earlier WaitForCompletion call also produced an error, the code returns the original error wrapped with the result-construction error's text via errors.Wrap(err, presultErr.Error()).","triggerScenarios":"Execute on a pipeline: WaitForCompletion returns an error AND newUniversalPipelineResult also fails (e.g. metrics fetch failed); the combined errors are returned wrapped.","commonSituations":"Remote job failed and its metrics endpoint is also unreachable/unavailable, so both error paths fire at once — typically during runner outages or jobs cancelled server-side.","solutions":["Read the outer error (from WaitForCompletion) first; it describes why the job failed.","Check the wrapped presultErr text for the secondary metrics-fetch problem and verify runner connectivity.","Inspect job logs via the runner's UI/CLI for the root failure cause.","Retry submission once the runner service is healthy."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"res, err := beam.Run(ctx, runner, p)\nif err != nil {\n    var wrapped interface{ Unwrap() error }\n    if errors.As(err, &wrapped) { log.Printf(\"outer job error: %v; inner: %v\", err, wrapped) }\n    // prioritize the outer error describing the job failure\n}","preventionTips":["Check the outer error first — it reflects the actual job failure.","Confirm runner connectivity for post-job metrics retrieval.","Keep runner sessions alive until results are consumed.","Log both the job id and error chain for support requests."],"tags":["go","beam","runner","grpc"],"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-14T16:17:12.679Z"}