{"record":{"id":"cbe06cb3b255722b","repo":"thanos-io/thanos","slug":"get-file-s","errorCode":null,"errorMessage":"get file: %s","messagePattern":"get file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/metadata/markers.go","lineNumber":126,"sourceCode":"\t// Details is a human readable string giving details of reason.\n\tDetails string `json:\"details,omitempty\"`\n\n\t// NoDownsampleTime is a unix timestamp of when the block was marked for no downsample.\n\tNoDownsampleTime int64              `json:\"no_downsample_time\"`\n\tReason           NoDownsampleReason `json:\"reason\"`\n}\n\nfunc (n *NoDownsampleMark) markerFilename() string { return NoDownsampleMarkFilename }\n\n// ReadMarker reads the given mark file from <dir>/<marker filename>.json in bucket.\nfunc ReadMarker(ctx context.Context, logger log.Logger, bkt objstore.InstrumentedBucketReader, dir string, marker Marker) error {\n\tmarkerFile := path.Join(dir, marker.markerFilename())\n\tr, err := bkt.ReaderWithExpectedErrs(bkt.IsObjNotFoundErr).Get(ctx, markerFile)\n\tif err != nil {\n\t\tif bkt.IsObjNotFoundErr(err) {\n\t\t\treturn ErrorMarkerNotFound\n\t\t}\n\t\treturn errors.Wrapf(err, \"get file: %s\", markerFile)\n\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 {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/metadata/markers.go#L108-L144","documentation":"Inside metadata.ReadMarker, after an attempt to fetch the marker file from the bucket fails with an error that is NOT an object-not-found error, the underlying error is wrapped with \"get file: <path>\". It means the object storage Get call itself failed (permissions, network, throttling, invalid key), not that the marker is absent.","triggerScenarios":"ReadMarker -> bkt.ReaderWithErrs(...).Get(ctx, markerFile) returns a non-NotFound error: expired/missing credentials, bucket not existing, network timeouts, S3/GCS throttling or server errors, or an invalid object key.","commonSituations":"Wrong credentials or IAM policy blocking the object; misconfigured bucket endpoint; transient cloud storage outages or rate limiting during compaction/fetcher runs.","solutions":["Inspect the wrapped cause (errors.Cause/errors.Is) to see the bucket provider error and fix credentials, bucket name, or endpoint configuration.","Retry the operation — many bucket errors are transient (throttling, network).","Verify the object key/path is correct and that the storage backend is reachable from this machine."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := metadata.ReadMarker(ctx, logger, bkt, id, mark); err != nil {\n\tif errors.Is(err, metadata.ErrorMarkerNotFound) { return nil }\n\tvar transient interface{ Temporary() bool }\n\tif errors.As(err, &transient) && transient.Temporary() {\n\t\t// retry with backoff\n\t}\n\treturn errors.Wrapf(err, \"reading marker for block %s\", id)\n}","preventionTips":["Check bucket credentials/IAM before running bulk fetch/compaction operations.","Enable retry with backoff in the object store client for 5xx and throttling errors.","Validate bucket name/endpoint configuration at startup."],"tags":["object-storage","network","bucket-get","wrapped-error"],"backgroundTag":"http-request-failed","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"}