{"record":{"id":"1b8352d3a8538f67","repo":"apache/beam","slug":"unable-to-decode-array-with-iterable-marker-v","errorCode":null,"errorMessage":"unable to decode array with iterable marker %v","messagePattern":"unable to decode array with iterable marker (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/coder.go","lineNumber":825,"sourceCode":"\t\treturn errors.Errorf(\"array len mismatch. decoding %v but only have %v elements.\", c.t, n)\n\t}\n\tswitch {\n\tcase n >= 0:\n\t\trv := reflect.New(c.t).Elem()\n\t\tvar e FullValue\n\t\tfor i := 0; i < int(n); i++ {\n\t\t\terr := c.dec.DecodeTo(r, &e)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif e.Elm != nil {\n\t\t\t\trv.Index(i).Set(reflect.ValueOf(e.Elm))\n\t\t\t}\n\t\t}\n\t\t*fv = FullValue{Elm: rv.Interface()}\n\t\treturn nil\n\tdefault:\n\t\treturn errors.Errorf(\"unable to decode array with iterable marker %v\", n)\n\t}\n}\n\nfunc (c *arrayDecoder) Decode(r io.Reader) (*FullValue, error) {\n\tfv := &FullValue{}\n\tif err := c.DecodeTo(r, fv); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fv, nil\n}\n\ntype windowedValueEncoder struct {\n\telm ElementEncoder\n\twin WindowEncoder\n\t// need to add pane encoder here\n}\n\nfunc (e *windowedValueEncoder) Encode(val *FullValue, w io.Writer) error {","sourceCodeStart":807,"sourceCodeEnd":843,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/coder.go#L807-L843","documentation":"After reading the element count n, the array decoder handles only the cases n >= 0 (fixed data) and n == -1 (iterable-backed / liquid-shard marker). Any other negative count is an unrecognized iterable marker and yields this error. It indicates a malformed or unsupported encoded representation for arrays.","triggerScenarios":"arrayDecoder.DecodeTo encounters a negative n that is not -1 — typically corrupted data, or a producer using a different/newer marker convention than this decoder understands.","commonSituations":"Version skew between writer and reader SDKs with different iterable marker values; corrupted streams; manually crafted or wrongly framed encoded data.","solutions":["Verify writer and reader use compatible SDK/coder versions so iterable markers agree.","Check data integrity — unexpected negative counts usually indicate truncation or corruption.","Inspect the encoder side (encodeRR/iterable markers) to confirm only -1 is used as the iterable marker.","Re-encode the dataset with the current SDK version if the wire format changed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// pre-validate an element count read from the wire\nfunc validArrayMarker(n int) bool {\n    return n >= 0 || n == -1 // -1 is the only supported iterable marker\n}","typeGuard":null,"tryCatchPattern":"if err := dec.DecodeTo(r, fv); err != nil {\n    if strings.Contains(err.Error(), \"iterable marker\") {\n        return fmt.Errorf(\"unsupported/corrupt iterable marker from writer: %w\", err)\n    }\n    return err\n}","preventionTips":["Keep writer and reader SDK versions identical so iterable markers match.","Validate stream framing/checksums to detect corrupted counts before decode.","Never hand-craft encoded arrays; use the SDK's encoder so markers stay valid.","Re-encode legacy data if migrating across encoding-format versions."],"tags":["go","apache-beam","decoding","iterable","coder"],"backgroundTag":"unexpected-response-shape","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"}