{"record":{"id":"44f8514d5f256bb4","repo":"thanos-io/thanos","slug":"v","errorCode":null,"errorMessage":"%v","messagePattern":"%v","errorType":"exception","errorClass":"ErrorSyncMetaNotFound","httpStatus":null,"severity":"warning","filePath":"pkg/block/fetcher.go","lineNumber":481,"sourceCode":"\t// Best effort load from local dir.\n\tif f.cacheDir != \"\" {\n\t\tm, err := metadata.ReadFromDir(cachedBlockDir)\n\t\tif err == nil {\n\t\t\treturn m, nil\n\t\t}\n\n\t\tif !errors.Is(err, os.ErrNotExist) {\n\t\t\tlevel.Warn(f.logger).Log(\"msg\", \"best effort read of the local meta.json failed; removing cached block dir\", \"dir\", cachedBlockDir, \"err\", err)\n\t\t\tif err := os.RemoveAll(cachedBlockDir); err != nil {\n\t\t\t\tlevel.Warn(f.logger).Log(\"msg\", \"best effort remove of cached dir failed; ignoring\", \"dir\", cachedBlockDir, \"err\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tr, err := f.bkt.ReaderWithExpectedErrs(f.bkt.IsObjNotFoundErr).Get(ctx, metaFile)\n\tif f.bkt.IsObjNotFoundErr(err) {\n\t\t// Meta.json was deleted between bkt.Exists and here.\n\t\treturn nil, errors.Wrapf(ErrorSyncMetaNotFound, \"%v\", err)\n\t}\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"get meta file: %v\", metaFile)\n\t}\n\n\tdefer runutil.CloseWithLogOnErr(f.logger, r, \"close bkt meta get\")\n\n\tmetaContent, err := io.ReadAll(r)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"read meta file: %v\", metaFile)\n\t}\n\n\tm := &metadata.Meta{}\n\tif err := json.Unmarshal(metaContent, m); err != nil {\n\t\treturn nil, errors.Wrapf(ErrorSyncMetaCorrupted, \"meta.json %v unmarshal: %v\", metaFile, err)\n\t}\n\n\tif m.Version != metadata.TSDBVersion1 {","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/fetcher.go#L463-L499","documentation":"This is the opaque '%v'-formatted wrapper produced in loadMeta when the object-not-found error is wrapped by ErrorSyncMetaNotFound: errors.Wrapf(ErrorSyncMetaNotFound, \"%v\", err). The message is literally the stringified underlying bucket error (e.g. the S3/GCS not-found message) and carries ErrorSyncMetaNotFound as its cause. It means meta.json vanished between the Exists check and the Get call.","triggerScenarios":"loadMeta: f.bkt.ReaderWithExpectedErrs(f.bkt.IsObjNotFoundErr).Get(ctx, metaFile) returns err where f.bkt.IsObjNotFoundErr(err) is true, so the error is re-wrapped with the '%v' format. Callers match it via errors.Is(err, ErrorSyncMetaNotFound).","commonSituations":"Concurrent compactor/GC deletion during block sync; lifecycle/expiration rules removing objects; another node cleaning up blocks; eventually-consistent stores returning stale Exists results.","solutions":["Handle as expected: the fetcher counts it as noMetas and continues; no action needed for a single occurrence.","Increase compactor deletion-delay so blocks are not removed while syncers are in flight.","Identify the deleting actor (compactor, lifecycle policy, manual cleanup) if it recurs frequently.","Verify bucket client configuration (endpoint, prefix) is correct so not-found errors are not caused by looking in the wrong location."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func isSyncMetaNotFound(err error) bool {\n    return errors.Is(err, block.ErrorSyncMetaNotFound)\n}","tryCatchPattern":"_, err := fetcher.Fetch(ctx, metas)\nif errors.Is(err, block.ErrorSyncMetaNotFound) {\n    // '%v' wrapper: same sentinel, match with errors.Is, not string compare\n    return // skip; block is gone\n}","preventionTips":["Match the sentinel with errors.Is/As, never by message text ('%v' is opaque)","Keep deletion-delay > sync interval to shrink the race window","Log occurrence counts; frequent hits mean another actor is deleting blocks","Re-run the sync; the block list will no longer include the deleted block"],"tags":["object-storage","race-condition","error-wrapping","thanos","retryable"],"backgroundTag":"resource-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"}