{"record":{"id":"c9d18691f104e383","repo":"apache/beam","slug":"unable-to-encode-pardopayload-for-v-in-stage-v-after-rewrite","errorCode":null,"errorMessage":"unable to encode ParDoPayload for %v in stage %v after rewrite","messagePattern":"unable to encode ParDoPayload for (.+?) in stage (.+?) after rewrite","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/stage.go","lineNumber":536,"sourceCode":"\t\tfor timerID, v := range pardo.GetTimerFamilySpecs() {\n\t\t\tstg.hasTimers = append(stg.hasTimers, engine.StaticTimerID{TransformID: tid, TimerFamily: timerID})\n\t\t\tif v.TimeDomain == pipepb.TimeDomain_PROCESSING_TIME {\n\t\t\t\tif stg.processingTimeTimers == nil {\n\t\t\t\t\tstg.processingTimeTimers = map[string]bool{}\n\t\t\t\t}\n\t\t\t\tstg.processingTimeTimers[timerID] = true\n\t\t\t}\n\t\t\trewrite = true\n\t\t\tnewCid, err := lpUnknownCoders(v.GetTimerFamilyCoderId(), coders, comps.GetCoders())\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to rewrite coder %v for timer %v for transform %v in stage %v: %w\", v.GetTimerFamilyCoderId(), timerID, tid, stg.ID, err)\n\t\t\t}\n\t\t\tv.TimerFamilyCoderId = newCid\n\t\t}\n\t\tif rewrite {\n\t\t\tpyld, err := proto.MarshalOptions{}.Marshal(pardo)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to encode ParDoPayload for %v in stage %v after rewrite\", tid, stg.ID)\n\t\t\t}\n\t\t\tt.Spec.Payload = pyld\n\t\t}\n\t}\n\tif len(transforms) == 0 {\n\t\treturn fmt.Errorf(\"buildDescriptor: invalid stage - no transforms at all %v\", stg.ID)\n\t}\n\n\t// Start with outputs, since they're simple and uniform.\n\tsink2Col := map[string]string{}\n\tcol2Coders := map[string]engine.PColInfo{}\n\tfor _, o := range stg.outputs {\n\t\tcol := clonePColToBundle(o.Global)\n\t\twOutCid, err := makeWindowedValueCoder(o.Global, comps, coders)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"buildDescriptor: failed to handle coder on stage %v for output %+v, pcol %q %v:\\n%w %v\", stg.ID, o, o.Global, prototext.Format(col), err, stg.transforms)\n\t\t}\n\t\tsinkID := o.Transform + \"_\" + o.Local","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/stage.go#L518-L554","documentation":"After prism rewrites timer coder IDs inside a ParDo payload, it re-marshals the ParDoPayload protobuf and writes it back to the transform spec. Failure of proto.Marshal means the in-memory payload could not be serialized, which is an internal inconsistency since the payload was originally valid protobuf.","triggerScenarios":"proto.MarshalOptions{}.Marshal(pardo) fails immediately after lpUnknownCoders mutated the ParDo's timer coder fields during buildDescriptor.","commonSituations":"Corrupted or hand-modified pipeline components; extremely large payloads hitting marshal limits; a prism/protobuf library bug rather than user error.","solutions":["Inspect the wrapped error details and the affected transform ID for anomalous fields","Re-run the pipeline unchanged to rule out a transient protobuf marshal issue","File a Beam issue with the transform ID if reproducible; this indicates an internal invariant violation","Verify pipeline protobuf was produced by a supported SDK version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := job.Submit(ctx); err != nil {\n    if strings.Contains(err.Error(), \"unable to encode ParDoPayload\") {\n        return fmt.Errorf(\"payload marshal failure, retry or report: %w\", err)\n    }\n    return err\n}","preventionTips":["Avoid hand-editing pipeline protos","Keep protobuf library versions current","Report reproducible marshal failures to Beam"],"tags":["beam","prism","protobuf","marshal"],"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"}