{"record":{"id":"a7d57de5516e7c7c","repo":"apache/beam","slug":"failed-to-read-from-v","errorCode":null,"errorMessage":"failed to read from %v","messagePattern":"failed to read from (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/artifact/gcsproxy/retrieval.go","lineNumber":116,"sourceCode":"\tr, err := client.Bucket(bucket).Object(object).NewReader(ctx)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"Failed to read object for %v\", key)\n\t}\n\tdefer r.Close()\n\n\tdata := make([]byte, 1<<20)\n\tfor {\n\t\tn, err := r.Read(data)\n\t\tif n > 0 {\n\t\t\tif err := stream.Send(&jobpb.ArtifactChunk{Data: data[:n]}); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"chunk send failed\")\n\t\t\t}\n\t\t}\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"failed to read from %v\", blob)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validate(md *jobpb.ProxyManifest) error {\n\tkeys := make(map[string]bool)\n\tfor _, a := range md.GetManifest().GetArtifact() {\n\t\tif _, seen := keys[a.Name]; seen {\n\t\t\treturn errors.Errorf(\"multiple artifact with name %v\", a.Name)\n\t\t}\n\t\tkeys[a.Name] = true\n\t}\n\tfor _, l := range md.GetLocation() {\n\t\tfresh, seen := keys[l.Name]\n\t\tif !seen {\n\t\t\treturn errors.Errorf(\"no artifact named %v for location %v\", l.Name, l.Uri)\n\t\t}","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/artifact/gcsproxy/retrieval.go#L98-L134","documentation":"GetArtifact reads the staged artifact from GCS in a loop; when the underlying GCS reader returns a non-EOF error this error wraps it with the blob path. It indicates the artifact blob could not be read from its GCS location (object missing, permissions, or transient GCS failure).","triggerScenarios":"r.Read(data) in GetArtifact returns an error that is not io.EOF; the reader was opened for the blob URI recorded in the ProxyManifest for the requested artifact name.","commonSituations":"The blob was deleted from the GCS bucket after staging (bucket lifecycle rules, manual cleanup); the retrieval server's credentials lack storage.objects.get on the bucket; transient GCS 5xx errors; a typo'd or stale manifest pointing at a moved object.","solutions":["Verify the blob exists in GCS at the path shown in the error message (gsutil ls).","Check the server's GCS credentials have read access (storage.objects.get) to the bucket.","Check the bucket has no lifecycle/delete rules removing staged blobs before job submission completes.","Retry on transient errors: GCS reads occasionally fail with retryable 5xx/429 errors.","Re-stage the pipeline if the manifest references an object that no longer exists."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Verify blob readability before/at failure time (server side)\nattrs, err := gcsClient.Bucket(bucket).Object(obj).Attrs(ctx)\n// err != nil means object missing or inaccessible — fail fast with that cause","typeGuard":null,"tryCatchPattern":"if err := getArtifact(ctx, name); err != nil {\n\tif strings.Contains(err.Error(), \"failed to read from\") {\n\t\t// re-check blob existence/permissions, then retry with backoff\n\t}\n}","preventionTips":["Don't apply GCS lifecycle rules to the staging bucket that expire blobs quickly.","Ensure retrieval server credentials can read the staging bucket.","Use distinct buckets per job to avoid cross-job cleanup deleting staged blobs.","Add retry with backoff for transient GCS read errors."],"tags":["gcs","io","storage","permissions"],"backgroundTag":"file-read-failed","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"}