thanos-io/thanos · error
open index writer
Error message
open index writer
What it means
Wraps tsdb index.NewWriter while creating the index file for the repaired block in Repair. It fires when the new index header/symbol table cannot be initialized on disk in the result directory, aborting the index repair workflow.
Solutions
- Check disk space and permissions on the repair output dir
- Ensure the result dir is writable and not locked
- Retry repair after fixing filesystem issues
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at pkg/block/index.go:460 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/1f48204a9f2febd1.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/block/index.go:460
defer runutil.CloseWithErrCapture(&err, indexr, "repair index reader")
chunkr, err := b.Chunks()
if err != nil {
return resid, errors.Wrap(err, "open chunks")
}
defer runutil.CloseWithErrCapture(&err, chunkr, "repair chunk reader")
resdir := filepath.Join(dir, resid.String())
chunkw, err := chunks.NewWriter(filepath.Join(resdir, ChunksDirname))
if err != nil {
return resid, errors.Wrap(err, "open chunk writer")
}
defer runutil.CloseWithErrCapture(&err, chunkw, "repair chunk writer")
indexw, err := index.NewWriter(context.TODO(), filepath.Join(resdir, IndexFilename))
if err != nil {
return resid, errors.Wrap(err, "open index writer")
}
defer runutil.CloseWithErrCapture(&err, indexw, "repair index writer")
// TODO(fabxc): adapt so we properly handle the version once we update to an upstream
// that has multiple.
resmeta := *meta
resmeta.ULID = resid
resmeta.Stats = tsdb.BlockStats{} // Reset stats.
resmeta.Thanos.Source = source // Update source.
if err := rewrite(ctx, logger, indexr, chunkr, indexw, chunkw, &resmeta, ignoreChkFns); err != nil {
return resid, errors.Wrap(err, "rewrite block")
}
resmeta.Thanos.SegmentFiles = GetSegmentFiles(resdir)
if err := resmeta.WriteToDir(logger, resdir); err != nil {
return resid, err
}
// TSDB may rewrite metadata in bdir.View on GitHub (pinned to 35b8b99117)