{"record":{"id":"295f1d5b199a7de7","repo":"apache/beam","slug":"failed-to-read-manifest-v","errorCode":null,"errorMessage":"failed to read manifest %v","messagePattern":"failed to read manifest (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/artifact/gcsproxy/retrieval.go","lineNumber":50,"sourceCode":"type RetrievalServer struct {\n\tmd    *jobpb.Manifest\n\tblobs map[string]string\n}\n\n// ReadProxyManifest reads and parses the proxy manifest from GCS.\nfunc ReadProxyManifest(ctx context.Context, object string) (*jobpb.ProxyManifest, error) {\n\tbucket, obj, err := gcsx.ParseObject(object)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"invalid manifest object %v\", object)\n\t}\n\n\tcl, err := gcsx.NewClient(ctx, storage.ScopeReadOnly)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to create GCS client\")\n\t}\n\tcontent, err := gcsx.ReadObject(ctx, cl, bucket, obj)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"failed to read manifest %v\", object)\n\t}\n\tvar md jobpb.ProxyManifest\n\tif err := proto.Unmarshal(content, &md); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"invalid manifest %v\", object)\n\t}\n\treturn &md, nil\n}\n\n// NewRetrievalServer creates a artifact retrieval server for the\n// given manifest. It requires that the locations are in GCS.\nfunc NewRetrievalServer(md *jobpb.ProxyManifest) (*RetrievalServer, error) {\n\tif err := validate(md); err != nil {\n\t\treturn nil, err\n\t}\n\n\tblobs := make(map[string]string)\n\tfor _, l := range md.GetLocation() {\n\t\tif _, _, err := gcsx.ParseObject(l.GetUri()); err != nil {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/artifact/gcsproxy/retrieval.go#L32-L68","documentation":"After creating the GCS client, ReadProxyManifest downloads the manifest object. This wrapped error is returned when gcsx.ReadObject fails to fetch the object bytes, e.g. the object does not exist or is not readable.","triggerScenarios":"Calling ReadProxyManifest with a gs:// path whose object is missing, deleted, or inaccessible to the credentials (403/404 from GCS during read).","commonSituations":"Typo in bucket or object name, manifest written by a different job run was garbage-collected, or the service account lacks storage.objects.get on the object.","solutions":["Verify the object exists: gsutil ls gs://bucket/path/to/manifest.","Grant the caller's service account storage.objects.get (roles/storage.objectViewer) on the bucket.","Check the path casing/spelling and that the job that wrote the manifest completed successfully."],"exampleFix":"// before (object not yet uploaded)\nmd, _ := ReadProxyManifest(ctx, manifestPath)\n// after: ensure writer finished before reading\nif err := waitForManifest(manifestPath); err != nil { return err }\nmd, err := ReadProxyManifest(ctx, manifestPath)","handlingStrategy":"retry","validationCode":"func manifestExists(ctx context.Context, obj string) bool { cl, err := gcsx.NewClient(ctx, storage.ScopeReadOnly); if err != nil { return false }; b, o, err := gcsx.ParseObject(obj); if err != nil { return false }; _, err = cl.Bucket(b).Object(o).Attrs(ctx); return err == nil }","typeGuard":null,"tryCatchPattern":"md, err := ReadProxyManifest(ctx, obj)\nif err != nil && strings.Contains(err.Error(), \"failed to read manifest\") { return fmt.Errorf(\"manifest %s missing/unreadable: %w\", obj, err) }","preventionTips":["Only read the manifest after the staging job that wrote it has completed.","Grant storage.objectViewer on the manifest bucket to the reading service."],"tags":["gcs","file-not-found","network","beam"],"backgroundTag":"resource-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"}