{"record":{"id":"1272caa7c642aae0","repo":"apache/beam","slug":"error-decoding-bool-field","errorCode":null,"errorMessage":"error decoding bool field","messagePattern":"error decoding bool field","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/coder/row_decoder.go","lineNumber":202,"sourceCode":"\t\t\tif IsFieldNil(nils, i) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfv := rv.Field(i)\n\t\t\tif f.addr {\n\t\t\t\tfv = fv.Addr()\n\t\t\t}\n\t\t\tif err := f.decode(fv, r); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}, nil\n}\n\nfunc reflectDecodeBool(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeBool(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding bool field\")\n\t}\n\trv.SetBool(v)\n\treturn nil\n}\n\nfunc reflectDecodeByte(rv reflect.Value, r io.Reader) error {\n\tb, err := DecodeByte(r)\n\tif err != nil {\n\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\")","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/coder/row_decoder.go#L184-L220","documentation":"Wraps an error from DecodeBool while decoding a bool field of a schema-coded row, then sets the field value. It indicates the underlying byte stream was corrupt, truncated, or misaligned at the position of a bool field.","triggerScenarios":"reflectDecodeBool invoked during row decoding when DecodeBool cannot read a valid bool byte: EOF mid-row, corrupt/truncated input, or decoding data written with a different coder.","commonSituations":"Reading truncated files or messages, cross-version data where field layouts shifted, feeding non-Beam-encoded bytes into a Beam row decoder.","solutions":["Verify the source data is complete and produced by a matching Beam row encoder.","Re-encode the input data with the current schema/coder.","Check field order/schema evolution compatibility between writer and reader.","Log the row offset and inspect the raw bytes for corruption."],"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 bool field\") {\n        return fmt.Errorf(\"row corrupt or truncated at bool field (offset %d): %w\", offset, err)\n    }\n    return err\n}","preventionTips":["Verify data integrity (checksums) before decoding Beam row blobs.","Keep writer and reader schemas in sync across pipeline versions.","Avoid manual byte manipulation of encoded rows.","Handle io.EOF distinctly as truncation upstream."],"tags":["decode-error","bool-field","row-decoding","io"],"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"}