{"record":{"id":"e34b1ee598f3207c","repo":"thanos-io/thanos","slug":"unexpected-no-downsample-mark-file-version-d-exp","errorCode":null,"errorMessage":"unexpected no-downsample-mark file version %d, expected %d","messagePattern":"unexpected no-downsample-mark file version (.+?), expected (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/metadata/markers.go","lineNumber":145,"sourceCode":"\t}\n\tdefer runutil.CloseWithLogOnErr(logger, r, \"close bkt marker reader\")\n\n\tmetaContent, err := io.ReadAll(r)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"read file: %s\", markerFile)\n\t}\n\n\tif err := json.Unmarshal(metaContent, marker); err != nil {\n\t\treturn errors.Wrapf(ErrorUnmarshalMarker, \"file: %s; err: %v\", markerFile, err.Error())\n\t}\n\tswitch marker.markerFilename() {\n\tcase NoCompactMarkFilename:\n\t\tif version := marker.(*NoCompactMark).Version; version != NoCompactMarkVersion1 {\n\t\t\treturn errors.Errorf(\"unexpected no-compact-mark file version %d, expected %d\", version, NoCompactMarkVersion1)\n\t\t}\n\tcase NoDownsampleMarkFilename:\n\t\tif version := marker.(*NoDownsampleMark).Version; version != NoDownsampleMarkVersion1 {\n\t\t\treturn errors.Errorf(\"unexpected no-downsample-mark file version %d, expected %d\", version, NoDownsampleMarkVersion1)\n\t\t}\n\tcase DeletionMarkFilename:\n\t\tif version := marker.(*DeletionMark).Version; version != DeletionMarkVersion1 {\n\t\t\treturn errors.Errorf(\"unexpected deletion-mark file version %d, expected %d\", version, DeletionMarkVersion1)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":127,"sourceCodeEnd":154,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/metadata/markers.go#L127-L154","documentation":"ReadMarker checks that a no-downsample-mark file's Version field equals NoDownsampleMarkVersion1. This error is raised when the marker file parses as JSON but carries an unsupported version number, so the binary refuses to interpret a marker written in a different format.","triggerScenarios":"Calling ReadMarker on a no-downsample-mark file whose decoded Version differs from NoDownsampleMarkVersion1 — typically a marker written by a newer M3DB release or a manually edited/hand-crafted marker file.","commonSituations":"Mixed-version cluster during rolling upgrades; downgrade of a node that already wrote a future-version marker; operator tampering with namespace metadata files; corrupted version field from bad disk writes.","solutions":["Read the Version field from the no-downsample-mark file and identify the writing M3DB version.","Upgrade the reading node to a binary that supports the marker version found in the file.","If downsampling can safely proceed, delete the stale marker and re-create it with version 1 via the current tooling.","Ensure all nodes in the cluster run compatible versions before performing namespace/downsampling operations."],"exampleFix":"// before: marker written with Version 3, reader expects 1 -> error\n\n// after: remove stale marker and rewrite with supported version\nos.Remove(noDownsampleMarkPath)\nWriteMarker(nsMd, blockID, &NoDownsampleMark{Version: NoDownsampleMarkVersion1})","handlingStrategy":"validation","validationCode":"var m struct{ Version int `json:\"version\"` }\nif json.Unmarshal(data, &m) == nil && m.Version != metadata.NoDownsampleMarkVersion1 {\n    // unsupported marker version: handle before ReadMarker\n}","typeGuard":"func isKnownNoDownsampleVersion(v int) bool { return v == metadata.NoDownsampleMarkVersion1 }","tryCatchPattern":"if err := metadata.ReadMarker(path, marker); err != nil {\n    if strings.Contains(err.Error(), \"unexpected no-downsample-mark file version\") {\n        return fmt.Errorf(\"no-downsample-mark version skew: %w\", err)\n    }\n    return err\n}","preventionTips":["Avoid mixed-version clusters; complete rolling upgrades before downsampling changes.","Do not edit no-downsample-mark files by hand.","Back up marker files with the same tool version that will restore them.","If a marker must be recreated, do it with the library's WriteMarker, which stamps the supported version."],"tags":["versioning","metadata","compatibility","m3db"],"backgroundTag":"invalid-enum-value","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}