{"record":{"id":"4ebc127f720f2388","repo":"apache/beam","slug":"invalid-manifest-v","errorCode":null,"errorMessage":"invalid manifest %v","messagePattern":"invalid manifest (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/artifact/gcsproxy/retrieval.go","lineNumber":54,"sourceCode":"\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 {\n\t\t\treturn nil, errors.Wrapf(err, \"location %v is not a GCS object\", l.GetUri())\n\t\t}\n\t\tblobs[l.GetName()] = l.GetUri()\n\t}","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/artifact/gcsproxy/retrieval.go#L36-L72","documentation":"ReadProxyManifest unmarshals the downloaded bytes as a protobuf ProxyManifest. This wrapped error is returned when proto.Unmarshal fails, meaning the object content is not a valid encoded ProxyManifest protobuf.","triggerScenarios":"Calling ReadProxyManifest against an object whose bytes are not the serialized ProxyManifest (e.g. JSON manifest, empty object, truncated upload, or a text file).","commonSituations":"A pipeline wrote the manifest in a different format/version, an upload was interrupted leaving corrupt bytes, or a user manually placed a file at the manifest path.","solutions":["Ensure the manifest was written as a serialized jobpb.ProxyManifest protobuf (proto.Marshal output), not JSON or YAML.","Re-generate/re-upload the manifest and retry.","Check that the writer and reader use compatible Beam versions for the ProxyManifest schema."],"exampleFix":"// before: writing JSON manifest\njson.NewEncoder(w).Encode(manifest)\n// after: write protobuf bytes\nb, _ := proto.Marshal(manifest)\nw.Write(b)","handlingStrategy":"validation","validationCode":"if len(content) == 0 { return errors.New(\"manifest object is empty\") }","typeGuard":null,"tryCatchPattern":"md, err := ReadProxyManifest(ctx, obj)\nif err != nil && strings.Contains(err.Error(), \"invalid manifest\") { return fmt.Errorf(\"manifest is not a valid ProxyManifest protobuf: %w\", err) }","preventionTips":["Always write manifests with proto.Marshal, never JSON/YAML encoders.","Guard against interrupted uploads (write-then-rename) when publishing manifests."],"tags":["protobuf","deserialization","gcs","beam"],"backgroundTag":"protobuf-unmarshal-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"}