{"record":{"id":"49c3cdb5d5cb9b53","repo":"apache/beam","slug":"decoding-time-v","errorCode":null,"errorMessage":"decoding time: %v","messagePattern":"decoding time: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/encoding.go","lineNumber":296,"sourceCode":"\t\tif err := coder.EncodeBytes(data, w); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, nil\n}\n\nfunc timeDec(reflect.Type) (func(io.Reader) (any, error), error) {\n\treturn func(r io.Reader) (any, error) {\n\t\tif err := coder.ReadSimpleRowHeader(1, r); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"decoding time.Time schema override\")\n\t\t}\n\t\tdata, err := coder.DecodeBytes(r)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"retrieving time data: %v\")\n\t\t}\n\t\tt := time.Time{}\n\t\tif err := t.UnmarshalText(data); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"decoding time: %v\")\n\t\t}\n\t\treturn t, nil\n\t}, nil\n}\n","sourceCodeStart":278,"sourceCodeEnd":301,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/encoding.go#L278-L301","documentation":"After successfully extracting the raw bytes in the time.Time schema override decoder, the bytes are parsed with time.Time.UnmarshalText (RFC3339 text format). If parsing fails, the error is wrapped as \"decoding time\". The stored bytes are not a valid textual timestamp.","triggerScenarios":"The time bytes retrieved via coder.DecodeBytes do not parse as RFC3339 text — e.g. data written by a non-text encoder (binary time.Time marshal) or garbage/corrupt bytes.","commonSituations":"Mixing encoders (writing with t.MarshalBinary, reading with the text-based override), hand-edited data, or upgrading Beam while data on disk was written with an older incompatible override.","solutions":["Ensure the encoding side uses the same timeEnc override (text-based) that produced these bytes.","Inspect the actual bytes; if they are binary, re-write the data using the matching encoder.","Check the wrapped UnmarshalText error to see the offending value and fix the producer.","If data is legacy binary, migrate it with a one-time conversion job before decoding with this override."],"exampleFix":"// before: binary time written, text expected\nbuf.Write(t.MarshalBinary())\n// after: match the decoder's expectation\ntext, _ := t.MarshalText()\ncoder.EncodeBytes(text, buf)","handlingStrategy":"validation","validationCode":"var probe time.Time\nif err := probe.UnmarshalText(data); err != nil {\n    return fmt.Errorf(\"data is not RFC3339 text: %w\", err)\n}","typeGuard":"func isRFC3339(b []byte) bool {\n    _, err := time.Parse(time.RFC3339, string(b))\n    return err == nil\n}","tryCatchPattern":"if _, err := time.Parse(time.RFC3339, string(data)); err != nil {\n    return fmt.Errorf(\"invalid stored timestamp %q: %w\", data, err)\n}","preventionTips":["Match encoder to decoder: use MarshalText on the write side","Validate sample records after encoding format changes","Run a migration when changing the time serialization format"],"tags":["beam","decoding","time-format","serialization"],"backgroundTag":"invalid-date-format","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}