{"record":{"id":"ce9a53ccd292cb89","repo":"apache/beam","slug":"decodestream-value-decode-failed","errorCode":null,"errorMessage":"decodeStream value decode failed","messagePattern":"decodeStream value decode failed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/fullvalue.go","lineNumber":257,"sourceCode":"\t\ts.next++\n\t}\n\ts.r = nil\n\ts.d = nil\n\ts.ret = FullValue{}\n\treturn nil\n}\n\n// Read produces the next value in the stream.\nfunc (s *decodeStream) Read() (*FullValue, error) {\n\tif s.r == nil || s.next == s.size {\n\t\treturn nil, io.EOF\n\t}\n\terr := s.d.DecodeTo(s.r, &s.ret)\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\treturn nil, io.EOF\n\t\t}\n\t\treturn nil, errors.Wrap(err, \"decodeStream value decode failed\")\n\t}\n\ts.next++\n\treturn &s.ret, nil\n}\n\n// singleUseMultiChunkReStream is a decode on demand restream, that can handle a multi-chunk streams.\n// Can only produce a single Stream because it consumes the reader.\n// Must not be used for streams that might be re-iterated, causing Open to be called twice.\ntype singleUseMultiChunkReStream struct {\n\tr *byteCountReader\n\td ElementDecoder\n\n\topen func(*byteCountReader) (Stream, error)\n}\n\n// Open returns the Stream from the start of the in-memory ReStream. Returns error if called twice.\nfunc (n *singleUseMultiChunkReStream) Open() (Stream, error) {\n\tif n.r == nil {","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/fullvalue.go#L239-L275","documentation":"Read on the single-value decode stream decodes the next element from the byte reader; a decode failure is wrapped as 'decodeStream value decode failed'. io.EOF is passed through cleanly, so this error specifically means bytes were present but could not be decoded into the expected type — typically a coder mismatch or corrupt payload.","triggerScenarios":"Read() on the decode stream where s.d.DecodeTo(s.r, &s.ret) fails with a non-EOF error while the plan is consuming an iter side input or GBK output, e.g. bytes encoded with coder A decoded with coder B.","commonSituations":"Coder mismatch after changing an element type without updating coders; corrupted payload from a failed data-plane hop; custom coder bug producing invalid bytes mid-record.","solutions":["Check that the coder used to encode the data matches the element type expected by the consuming DoFn.","Rerun the affected bundle — transient corruption is retried automatically by the runner.","If a custom coder is involved, validate it round-trips sample values before use.","Ensure all SDK containers/workers are the same version to avoid coder wire-format drift."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if wrapped := errors.Unwrap(err); wrapped != nil && wrapped != io.EOF {\n    // decode corruption: mark bundle retryable, alert if it recurs on the same key\n    return fmt.Errorf(\"retryable decode failure: %w\", wrapped)\n}","preventionTips":["Keep element types and coders in sync between producing and consuming stages.","Test custom coders with encode/decode round-trips.","Watch for recurring failures on the same partition indicating systematic corruption."],"tags":["go","apache-beam","decoding","coder"],"backgroundTag":"stream-decode-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"}