{"record":{"id":"7daec20ebfaa3137","repo":"apache/beam","slug":"invalid-transform-payload-v-for-v","errorCode":null,"errorMessage":"invalid transform payload %v for %v","messagePattern":"invalid transform payload (.+?) for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/translate.go","lineNumber":550,"sourceCode":"\t\t\t\t\tinput := unmarshalKeyedValues(transform.GetInputs())\n\n\t\t\t\t\tif len(userState) > 0 {\n\t\t\t\t\t\tstateIDToCoder := make(map[string]*coder.Coder)\n\t\t\t\t\t\tstateIDToKeyCoder := make(map[string]*coder.Coder)\n\t\t\t\t\t\tstateIDToCombineFn := make(map[string]*graph.CombineFn)\n\t\t\t\t\t\tfor key, spec := range userState {\n\t\t\t\t\t\t\tvar cID string\n\t\t\t\t\t\t\tvar kcID string\n\t\t\t\t\t\t\tif rmw := spec.GetReadModifyWriteSpec(); rmw != nil {\n\t\t\t\t\t\t\t\tcID = rmw.CoderId\n\t\t\t\t\t\t\t} else if bs := spec.GetBagSpec(); bs != nil {\n\t\t\t\t\t\t\t\tcID = bs.ElementCoderId\n\t\t\t\t\t\t\t} else if cs := spec.GetCombiningSpec(); cs != nil {\n\t\t\t\t\t\t\t\tcID = cs.AccumulatorCoderId\n\t\t\t\t\t\t\t\tcmbData := string(cs.GetCombineFn().GetPayload())\n\t\t\t\t\t\t\t\tvar cmbTp v1pb.TransformPayload\n\t\t\t\t\t\t\t\tif err := protox.DecodeBase64(cmbData, &cmbTp); err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, errors.Wrapf(err, \"invalid transform payload %v for %v\", cmbData, transform)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t_, fn, _, _, _, err := graphx.DecodeMultiEdge(cmbTp.GetEdge())\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcfn, err := graph.AsCombineFn(fn)\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstateIDToCombineFn[key] = cfn\n\t\t\t\t\t\t\t} else if ms := spec.GetMapSpec(); ms != nil {\n\t\t\t\t\t\t\t\tcID = ms.ValueCoderId\n\t\t\t\t\t\t\t\tkcID = ms.KeyCoderId\n\t\t\t\t\t\t\t} else if ss := spec.GetSetSpec(); ss != nil {\n\t\t\t\t\t\t\t\tkcID = ss.ElementCoderId\n\t\t\t\t\t\t\t} else if ols := spec.GetOrderedListSpec(); ols != nil {\n\t\t\t\t\t\t\t\tcID = ols.ElementCoderId\n\t\t\t\t\t\t\t} else {","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/translate.go#L532-L568","documentation":"During pipeline decoding in makeLink, when a ParDo has a CombiningSpec user state, the combine fn's base64-encoded TransformPayload is decoded. If protox.DecodeBase64 fails, the translation aborts wrapped in this error, meaning the runner sent a malformed or unreadable combine-fn payload for a stateful DoFn.","triggerScenarios":"A combining user state (beam.CombineContext/PerKey state) whose CombineFn payload is not valid base64-encoded TransformPayload protobuf — e.g. corrupt job submission, cross-version runner/Fn Harness mismatch, or a custom transform writing a hand-built state spec.","commonSituations":"Runner and SDK harness from different Beam versions where the TransformPayload encoding changed; manually constructed pipeline protobufs; corrupted/stale worker caches during container upgrades.","solutions":["Pin the Go Beam SDK and runner/container to the same version and redeploy","Regenerate/rebuild the pipeline so the combine payload is re-encoded, and resubmit the job","Decode the cmbData base64 offline to confirm it parses as v1pb.TransformPayload before submitting","Update custom transform code that manually writes CombiningSpec payloads to use the official graphx encoding"],"exampleFix":"// Hand-built state spec with raw payload\nspec.CombiningSpec.CombineFn.Payload = []byte(myString)\n// after: encode properly\nvar cmb v1pb.TransformPayload\nb, _ := proto.Marshal(&cmb)\nspec.CombiningSpec.CombineFn.Payload = []byte(base64.StdEncoding.EncodeToString(b))","handlingStrategy":"validation","validationCode":"var tp v1pb.TransformPayload\nif _, err := base64.StdEncoding.DecodeString(string(cs.GetCombineFn().GetPayload())); err != nil {\n\treturn fmt.Errorf(\"combine payload is not valid base64: %w\", err)\n}\nif err := protox.DecodeBase64(string(cs.GetCombineFn().GetPayload()), &tp); err != nil {\n\treturn fmt.Errorf(\"combine payload does not decode: %w\", err)\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Keep the Go SDK harness and pipeline builder on identical Beam versions","Never hand-construct CombiningSpec payloads; use the SDK's graphx encoders","Resubmit jobs from a clean build when translation errors appear after an upgrade"],"tags":["go","apache-beam","protobuf","pipeline-translation"],"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-14T16:17:12.679Z"}