thanos-io/thanos · error
get file
Error message
get file: %s
What it means
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.
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.
Defensive patterns
Strategy: retry
Try / catch
if err := metadata.ReadMarker(ctx, logger, bkt, id, mark); err != nil {
if errors.Is(err, metadata.ErrorMarkerNotFound) { return nil }
var transient interface{ Temporary() bool }
if errors.As(err, &transient) && transient.Temporary() {
// retry with backoff
}
return errors.Wrapf(err, "reading marker for block %s", id)
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Wrong credentials or IAM policy blocking the object; misconfigured bucket endpoint; transient cloud storage outages or rate limiting during compaction/fetcher runs.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- read file
- sync before first pass of downsampling
- sync before second pass of downsampling
- upload file to bucket
- stat
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/cbe06cb3b255722b.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/block/metadata/markers.go:126
// Details is a human readable string giving details of reason.
Details string `json:"details,omitempty"`
// NoDownsampleTime is a unix timestamp of when the block was marked for no downsample.
NoDownsampleTime int64 `json:"no_downsample_time"`
Reason NoDownsampleReason `json:"reason"`
}
func (n *NoDownsampleMark) markerFilename() string { return NoDownsampleMarkFilename }
// ReadMarker reads the given mark file from <dir>/<marker filename>.json in bucket.
func ReadMarker(ctx context.Context, logger log.Logger, bkt objstore.InstrumentedBucketReader, dir string, marker Marker) error {
markerFile := path.Join(dir, marker.markerFilename())
r, err := bkt.ReaderWithExpectedErrs(bkt.IsObjNotFoundErr).Get(ctx, markerFile)
if err != nil {
if bkt.IsObjNotFoundErr(err) {
return ErrorMarkerNotFound
}
return errors.Wrapf(err, "get file: %s", markerFile)
}
defer runutil.CloseWithLogOnErr(logger, r, "close bkt marker reader")
metaContent, err := io.ReadAll(r)
if err != nil {
return errors.Wrapf(err, "read file: %s", markerFile)
}
if err := json.Unmarshal(metaContent, marker); err != nil {
return errors.Wrapf(ErrorUnmarshalMarker, "file: %s; err: %v", markerFile, err.Error())
}
switch marker.markerFilename() {
case NoCompactMarkFilename:
if version := marker.(*NoCompactMark).Version; version != NoCompactMarkVersion1 {
return errors.Errorf("unexpected no-compact-mark file version %d, expected %d", version, NoCompactMarkVersion1)
}
case NoDownsampleMarkFilename:
if version := marker.(*NoDownsampleMark).Version; version != NoDownsampleMarkVersion1 {View on GitHub (pinned to 35b8b99117)