{"record":{"id":"76cdb77a42d6164c","repo":"apache/beam","slug":"failed-to-stage-go-worker-binary-v","errorCode":null,"errorMessage":"failed to stage Go worker binary: %v","messagePattern":"failed to stage Go worker binary: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/universal/runnerlib/stage.go","lineNumber":119,"sourceCode":"\t\t\t\tResponse: &jobpb.ArtifactResponseWrapper_ResolveArtifactResponse{\n\t\t\t\t\tResolveArtifactResponse: &jobpb.ResolveArtifactsResponse{\n\t\t\t\t\t\tReplacements: request.ResolveArtifact.Artifacts,\n\t\t\t\t\t},\n\t\t\t\t}})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\tcase *jobpb.ArtifactRequestWrapper_GetArtifact:\n\t\t\tswitch typeUrn := request.GetArtifact.Artifact.TypeUrn; typeUrn {\n\t\t\t// TODO(https://github.com/apache/beam/issues/21459): Legacy Type URN. If requested, provide the binary.\n\t\t\t// To be removed later in 2022, once thoroughly obsolete.\n\t\t\tcase graphx.URNArtifactGoWorker:\n\t\t\t\tif err := stageFile(binary, stream); err != nil {\n\t\t\t\t\tif err == io.EOF {\n\t\t\t\t\t\tcontinue // so we can get the real error from stream.Recv.\n\t\t\t\t\t}\n\t\t\t\t\treturn errors.Wrapf(err, \"failed to stage Go worker binary: %v\", binary)\n\t\t\t\t}\n\t\t\tcase graphx.URNArtifactFileType:\n\t\t\t\ttypePl := pipepb.ArtifactFilePayload{}\n\t\t\t\tif err := proto.Unmarshal(request.GetArtifact.Artifact.TypePayload, &typePl); err != nil {\n\t\t\t\t\treturn errors.Wrap(err, \"failed to parse artifact file payload\")\n\t\t\t\t}\n\t\t\t\tif err := stageFile(typePl.GetPath(), stream); err != nil {\n\t\t\t\t\tif err == io.EOF {\n\t\t\t\t\t\tcontinue // so we can get the real error from stream.Recv.\n\t\t\t\t\t}\n\t\t\t\t\treturn errors.Wrapf(err, \"failed to stage file %v\", typePl.GetPath())\n\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn errors.Errorf(\"request has unexpected artifact type %s\", typeUrn)\n\t\t\t}\n\n\t\tdefault:","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/universal/runnerlib/stage.go#L101-L137","documentation":"stageFiles wraps the error from stageFile when staging the prebuilt Go worker binary (URN graphx.URNArtifactGoWorker) fails on the staging stream. An io.EOF is intentionally not wrapped — it falls through to get the real stream error — so this error means a real send/open failure while uploading the binary.","triggerScenarios":"stageFile(binary, stream) returns a non-EOF error: os.Open failed on the worker binary, or a stream.Send of file chunks failed mid-upload.","commonSituations":"Worker binary not built before submission (go build skipped), binary path wrong due to --workerBinary flag mistake, connection dropped during a large binary upload.","solutions":["Ensure the Go worker binary is built (go build) and the correct path is passed","Check os.Open failure in the wrapped error (file-not-found vs permission)","Retry on transient gRPC errors; StageViaPortableAPI already retries at a higher level","Increase timeouts for large binaries over slow links"],"exampleFix":"// before\nreturn errors.Wrapf(err, \"failed to stage Go worker binary: %v\", binary)\n// after: build first, e.g.\n// go build -o worker/main worker/main.go\n// ./submit --workerBinary=worker/main ...","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(workerBinary); err != nil {\n  return fmt.Errorf(\"worker binary missing at %s: %w\", workerBinary, err)\n}","typeGuard":null,"tryCatchPattern":"if err := submit(...); err != nil && strings.Contains(err.Error(), \"failed to stage Go worker binary\") {\n  // check os.Open failure in wrapped err: path wrong or binary not built\n}","preventionTips":["Always run go build before pipeline submission","Verify the --workerBinary path exists and is executable","Keep artifact sizes within network timeout budgets"],"tags":["artifact-staging","file-not-found","grpc","go-worker-binary"],"backgroundTag":"file-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"}