{"record":{"id":"e68376ab840d1ff9","repo":"thanos-io/thanos","slug":"marker-not-found","errorCode":null,"errorMessage":"marker not found","messagePattern":"marker not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/block/metadata/markers.go","lineNumber":40,"sourceCode":"\t// If such file is present in block dir, it means the block is meant to be deleted after certain delay.\n\tDeletionMarkFilename = \"deletion-mark.json\"\n\t// NoCompactMarkFilename is the known json filename for optional file storing details about why block has to be excluded from compaction.\n\t// If such file is present in block dir, it means the block has to excluded from compaction (both vertical and horizontal) or rewrite (e.g deletions).\n\tNoCompactMarkFilename = \"no-compact-mark.json\"\n\t// NoDownsampleMarkFilename is the known json filenanme for optional file storing details about why block has to be excluded from downsampling.\n\t// If such file is present in block dir, it means the block has to be excluded from downsampling.\n\tNoDownsampleMarkFilename = \"no-downsample-mark.json\"\n\t// DeletionMarkVersion1 is the version of deletion-mark file supported by Thanos.\n\tDeletionMarkVersion1 = 1\n\t// NoCompactMarkVersion1 is the version of no-compact-mark file supported by Thanos.\n\tNoCompactMarkVersion1 = 1\n\t// NoDownsampleVersion1 is the version of no-downsample-mark file supported by Thanos.\n\tNoDownsampleMarkVersion1 = 1\n)\n\nvar (\n\t// ErrorMarkerNotFound is the error when marker file is not found.\n\tErrorMarkerNotFound = errors.New(\"marker not found\")\n\t// ErrorUnmarshalMarker is the error when unmarshalling marker JSON file.\n\t// This error can occur because marker has been partially uploaded to block storage\n\t// or the marker file is not a valid json file.\n\tErrorUnmarshalMarker = errors.New(\"unmarshal marker JSON\")\n)\n\ntype Marker interface {\n\tmarkerFilename() string\n}\n\n// DeletionMark stores block id and when block was marked for deletion.\ntype DeletionMark struct {\n\t// ID of the tsdb block.\n\tID ulid.ULID `json:\"id\"`\n\t// Version of the file.\n\tVersion int `json:\"version\"`\n\t// Details is a human readable string giving details of reason.\n\tDetails string `json:\"details,omitempty\"`","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/metadata/markers.go#L22-L58","documentation":"ErrorMarkerNotFound is the sentinel error returned by metadata.ReadMarker when the marker file (e.g. deletion-mark.json or no-downsample-mark.json) does not exist in the object storage bucket. It is exported so callers can compare with errors.Cause / errors.Is and treat absence as a normal, expected outcome rather than a failure.","triggerScenarios":"metadata.ReadMarker is called for a block whose marker file was never written, was deleted, or the block itself does not exist in the bucket; bkt.Get returns an object-not-found error which ReadMarker maps to this sentinel.","commonSituations":"Fetcher scanning all blocks for deletion marks where most blocks legitimately have no deletion-mark.json; eventual consistency lag right after block upload; wrong bucket/endpoint configuration so expected markers are 'missing'; blocks removed by compaction.","solutions":["Treat it as a non-error: skip the block (as pkg/block/fetcher.go does with 'continue') instead of failing the operation.","Verify the bucket/endpoint configuration points at the storage where the markers actually live.","If the marker is expected to exist, re-check its upload (partial upload lifecycle) or regenerate the marker file."],"exampleFix":"// before\nif err := metadata.ReadMarker(ctx, logger, bkt, id.String(), m); err != nil {\n\treturn err\n}\n// after\nif err := metadata.ReadMarker(ctx, logger, bkt, id.String(), m); err != nil {\n\tif errors.Cause(err) == metadata.ErrorMarkerNotFound {\n\t\tcontinue // marker absent: nothing to process\n\t}\n\treturn err\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := metadata.ReadMarker(ctx, logger, bkt, id.String(), mark)\nif err != nil {\n\tif errors.Cause(err) == metadata.ErrorMarkerNotFound {\n\t\t// marker absent: normal case, skip block\n\t\treturn nil\n\t}\n\treturn err\n}","preventionTips":["Always compare with errors.Cause/errors.Is against the metadata.ErrorMarkerNotFound sentinel, never against the message string.","Do not treat marker absence as fatal in fetch/compaction scans.","Verify bucket/endpoint config before scanning so legit markers are not reported missing."],"tags":["object-storage","marker-file","not-found","sentinel-error"],"backgroundTag":"file-not-found","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"}