{"record":{"id":"c997f1364a0e91f4","repo":"apache/beam","slug":"error-decoding-varint-field","errorCode":null,"errorMessage":"error decoding varint field","messagePattern":"error decoding varint field","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/coder/row_decoder.go","lineNumber":229,"sourceCode":"\t\treturn errors.Wrap(err, \"error decoding single byte field\")\n\t}\n\trv.SetUint(uint64(b))\n\treturn nil\n}\n\nfunc reflectDecodeString(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeStringUTF8(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding string field\")\n\t}\n\trv.SetString(v)\n\treturn nil\n}\n\nfunc reflectDecodeInt(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeVarInt(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding varint field\")\n\t}\n\trv.SetInt(v)\n\treturn nil\n}\n\nfunc reflectDecodeUint(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeVarUint64(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding varint field\")\n\t}\n\trv.SetUint(v)\n\treturn nil\n}\n\nfunc reflectDecodeSinglePrecisionFloat(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeSinglePrecisionFloat(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding single-precision float field\")","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/coder/row_decoder.go#L211-L247","documentation":"Wrap added by reflectDecodeInt in the reflective row decoder when DecodeVarInt fails. The Beam wire format encodes int fields as varints; this error means the reader hit EOF or garbage while decoding such a field, i.e. the row bytes are truncated or were produced with an incompatible coder.","triggerScenarios":"reflectDecodeInt during row decoding when DecodeVarInt hits EOF or encounters a malformed varint — truncated input or misaligned decode of foreign data.","commonSituations":"Truncated Beam-encoded blobs, cross-version coder mismatch, decoding data written by other frameworks into Beam row coders.","solutions":["Verify data completeness and that it was written by a compatible Beam encoder.","Re-encode the input data.","Align reader/writer schemas so field positions match.","Check for varint corruption at the failing offset."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := decoderFn(rv, r); err != nil {\n    if strings.Contains(err.Error(), \"error decoding varint field\") {\n        return fmt.Errorf(\"malformed or truncated varint in int field: %w\", err)\n    }\n    return err\n}","preventionTips":["Verify varint fields are written by the same Beam SDK version.","Validate input completeness before decoding.","Avoid mixing int widths/types across schema versions.","Add offset logging when decoding large blobs."],"tags":["decode-error","int-field","varint","row-decoding"],"backgroundTag":"file-read-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"}