{"record":{"id":"fef35d1694b65293","repo":"apache/beam","slug":"failed-to-marshal-proxy-manifest","errorCode":null,"errorMessage":"failed to marshal proxy manifest","messagePattern":"failed to marshal proxy manifest","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/artifact/gcsproxy/staging.go","lineNumber":80,"sourceCode":"\t\tblobs:    make(map[string]staged),\n\t}, nil\n}\n\n// CommitManifest commits the given artifact manifest to GCS.\nfunc (s *StagingServer) CommitManifest(ctx context.Context, req *jobpb.CommitManifestRequest) (*jobpb.CommitManifestResponse, error) {\n\tmanifest := req.GetManifest()\n\n\ts.mu.Lock()\n\tloc, err := matchLocations(manifest.GetArtifact(), s.blobs)\n\tif err != nil {\n\t\ts.mu.Unlock()\n\t\treturn nil, err\n\t}\n\ts.mu.Unlock()\n\n\tdata, err := proto.Marshal(&jobpb.ProxyManifest{Manifest: manifest, Location: loc})\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to marshal proxy manifest\")\n\t}\n\n\tcl, err := gcsx.NewClient(ctx, storage.ScopeReadWrite)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to create GCS client\")\n\t}\n\tif err := gcsx.WriteObject(ctx, cl, s.bucket, s.manifest, bytes.NewReader(data)); err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to write manifest\")\n\t}\n\n\t// Commit returns the location of the manifest as the token, which can\n\t// then be used to configure the retrieval proxy. It is redundant right\n\t// now, but would be needed for a staging server that serves multiple\n\t// jobs. Such a server would also use the ID sent with each request.\n\n\treturn &jobpb.CommitManifestResponse{RetrievalToken: gcsx.MakeObject(s.bucket, s.manifest)}, nil\n}\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/artifact/gcsproxy/staging.go#L62-L98","documentation":"CommitManifest serializes the ProxyManifest (artifacts plus their GCS locations) with proto.Marshal before uploading it to GCS. This error wraps a proto marshaling failure, which is rare but can occur if the message tree contains invalid data that cannot be encoded.","triggerScenarios":"proto.Marshal(&jobpb.ProxyManifest{Manifest: manifest, Location: loc}) returns non-nil during CommitManifest, after all staged artifacts have been recorded.","commonSituations":"Corrupt or nil-required fields introduced into the manifest by custom staging code; incompatible generated proto types from mismatched beam versions in a custom build; memory corruption is effectively unheard of — usually a custom-modified message.","solutions":["Check that artifact and location entries added during staging contain valid, non-nil fields.","Ensure the generated jobpb/pipepb packages come from the same Beam version to avoid proto descriptor mismatches.","Log manifest.Artifact and loc contents before marshaling to spot invalid entries.","Retry the pipeline; if reproducible, file an issue with the artifact names/URIs involved."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check manifest entries are sane before commit\nfor _, a := range manifest.GetArtifact() {\n\tif a.Name == \"\" { return errors.New(\"artifact with empty name\") }\n}","typeGuard":null,"tryCatchPattern":"data, err := proto.Marshal(md)\nif err != nil {\n\treturn nil, fmt.Errorf(\"proxy manifest marshal failed: %w\", err)\n}","preventionTips":["Keep jobpb/pipepb generated code in lockstep with the Beam version.","Avoid mutating manifest protos with ad-hoc custom code.","Validate artifact/location entries before commit."],"tags":["protobuf","serialization","manifest"],"backgroundTag":"json-marshal-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"}