{"record":{"id":"28d70abd5cbcfbee","repo":"apache/beam","slug":"zero-length-data-for-v","errorCode":null,"errorMessage":"zero length data for %v: ","messagePattern":"zero length data for (.+?): ","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go","lineNumber":888,"sourceCode":"\t// be scheduled when this stage's output watermark is held back. Only needed\n\t// once something self checkpoints, so pipelines that never do keep their\n\t// previous bundle scheduling exactly.\n\tif len(residuals.Data) > 0 {\n\t\tem.sawResidual.Store(true)\n\t}\n\tvar changedConsumers set[string]\n\tif em.sawResidual.Load() {\n\t\tchangedConsumers = set[string]{}\n\t}\n\tvar seq int\n\tfor output, data := range d.Raw {\n\t\tinfo := col2Coders[output]\n\t\tvar newPending []element\n\t\tslog.Debug(\"PersistBundle: processing output\", \"bundle\", rb, slog.String(\"output\", output))\n\t\tfor _, datum := range data {\n\t\t\tbuf := bytes.NewBuffer(datum)\n\t\t\tif len(datum) == 0 {\n\t\t\t\tpanic(fmt.Sprintf(\"zero length data for %v: \", output))\n\t\t\t}\n\t\t\tfor {\n\t\t\t\tvar rawBytes bytes.Buffer\n\t\t\t\ttee := io.TeeReader(buf, &rawBytes)\n\t\t\t\tws, et, pn, err := exec.DecodeWindowedValueHeader(info.WDec, tee)\n\t\t\t\tif err != nil {\n\t\t\t\t\tif err == io.EOF {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tslog.Error(\"PersistBundle: error decoding watermarks\", \"error\", err, \"bundle\", rb, slog.String(\"output\", output))\n\t\t\t\t\tpanic(\"error decoding watermarks\")\n\t\t\t\t}\n\t\t\t\tif len(ws) == 0 {\n\t\t\t\t\tslog.Warn(\"PersistBundle: sdk provided a windowed value header 0 windows\", \"bundle\", rb)\n\t\t\t\t}\n\t\t\t\t// TODO: Optimize unnecessary copies. This is doubleteeing.\n\t\t\t\telmBytes := info.EDec(tee)\n\t\t\t\tvar keyBytes []byte","sourceCodeStart":870,"sourceCodeEnd":906,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go#L870-L906","documentation":"PersistBundle processes each output datum's bytes and expects at least the windowed-value header. An empty data slice cannot contain any elements, so prism panics — a bundle sent data with zero length for an output, violating the element protocol.","triggerScenarios":"In PersistBundle, a datum in the data list for an output has len(datum) == 0: the SDK/harness streamed an empty byte blob for an output that should carry encoded elements.","commonSituations":"Harness/SDK bug emitting empty data frames; network or transport layer truncation producing zero-length payloads; version skew in the element data framing protocol.","solutions":["Upgrade SDK and prism to matching Beam versions","Inspect logs for the transform/output named in the panic to find the producing stage","Report a bug with the bundle/transform details if the SDK legitimately emits empty data","Retry the job to rule out transient transport corruption"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for _, d := range data { if len(d) == 0 { return errors.New(\"empty data blob in bundle output\") } }","typeGuard":null,"tryCatchPattern":"defer func() { if r := recover(); r != nil { log.Errorf(\"persist bundle panicked: %v\", r) } }()","preventionTips":["Match SDK/harness and prism versions to avoid framing protocol skew","Monitor transport layers for truncation/empty frame bugs","File SDK bugs with the output/transform named in the panic message"],"tags":["go","beam","prism","data","empty-payload","panic"],"backgroundTag":"empty-required-field","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"}