{"record":{"id":"b78f67881ec3c787","repo":"thanos-io/thanos","slug":"write-meta-meta","errorCode":null,"errorMessage":"write meta meta","messagePattern":"write meta meta","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compact/downsample/streamed_block_writer.go","lineNumber":165,"sourceCode":"\n\tmerr := errutil.MultiError{}\n\n\tif w.ignoreFinalize {\n\t\t// Close open file descriptors anyway.\n\t\tfor _, cl := range w.closers {\n\t\t\tmerr.Add(cl.Close())\n\t\t}\n\t\treturn merr.Err()\n\t}\n\n\t// Finalize saves prepared index and metadata to corresponding files.\n\n\tfor _, cl := range w.closers {\n\t\tmerr.Add(cl.Close())\n\t}\n\n\tif err := w.writeMetaFile(); err != nil {\n\t\treturn errors.Wrap(err, \"write meta meta\")\n\t}\n\n\tif err := w.syncDir(); err != nil {\n\t\treturn errors.Wrap(err, \"sync blockDir\")\n\t}\n\n\tif err := merr.Err(); err != nil {\n\t\treturn errors.Wrap(err, \"finalize\")\n\t}\n\n\t// No error, claim success.\n\n\tlevel.Info(w.logger).Log(\n\t\t\"msg\", \"finalized downsampled block\",\n\t\t\"mint\", w.meta.MinTime,\n\t\t\"maxt\", w.meta.MaxTime,\n\t\t\"ulid\", w.meta.ULID,\n\t\t\"resolution\", w.meta.Thanos.Downsample.Resolution,","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/compact/downsample/streamed_block_writer.go#L147-L183","documentation":"errors.Wrap around writeMetaFile failure in streamedBlockWriter.Close: persisting the final meta.json for the downsampled block failed (I/O error, missing dir, permissions), so the block is not usable.","triggerScenarios":"Thrown at pkg/compact/downsample/streamed_block_writer.go:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped writeMetaFile error for the underlying cause (disk full, permissions).","Ensure the block directory exists and is writable before Close.","Retry the downsampling run; delete the failed block."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}