{"record":{"id":"e3cd05ccc843ad5e","repo":"thanos-io/thanos","slug":"open-storage-dir","errorCode":null,"errorMessage":"open storage dir","messagePattern":"open storage dir","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":217,"sourceCode":"\t\t\tbkt, err = client.NewBucket(logger, confContentYaml, comp.String(), nil)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbkt = objstoretracing.WrapWithTraces(objstore.WrapWithMetrics(bkt, extprom.WrapRegistererWithPrefix(\"thanos_\", reg), bkt.Name()))\n\t\t} else {\n\t\t\tlevel.Info(logger).Log(\"msg\", \"no supported bucket was configured, uploads will be disabled\")\n\t\t}\n\t}\n\n\tvar dataDir *os.Root\n\tif enableIngestion {\n\t\tif err := os.MkdirAll(conf.dataDir, 0o755); err != nil {\n\t\t\treturn errors.Wrapf(err, \"create data dir in %v\", conf.dataDir)\n\t\t}\n\n\t\tdataDir, err = os.OpenRoot(conf.dataDir)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"open storage dir\")\n\t\t}\n\n\t\t// Create TSDB for the default tenant.\n\t\tif err := createDefautTenantTSDB(logger, conf.defaultTenantID, dataDir); err != nil {\n\t\t\treturn errors.Wrapf(err, \"create default tenant tsdb in %v\", conf.dataDir)\n\t\t}\n\t}\n\n\trelabelConfig, err := conf.relabelCfg.RelabelConfig(nil)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get relabel configuration\")\n\t}\n\n\tvar cache = storecache.NoopMatchersCache\n\tif conf.matcherCacheSize > 0 {\n\t\tcache, err = storecache.NewMatchersCache(storecache.WithSize(conf.matcherCacheSize), storecache.WithPromRegistry(reg))\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to create matchers cache\")","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L199-L235","documentation":"os.OpenRoot failed on the receive data directory after creating it. This obtains a rooted-handle for safe tenant-scoped file access; failure indicates the directory vanished, permission issues, or an unsupported filesystem.","triggerScenarios":"Thrown at cmd/thanos/receive.go:217 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-check data dir permissions after creation errors","Ensure the filesystem supports openat2/O_PATH semantics (or run a newer kernel)","Confirm nothing deletes the data dir concurrently"],"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"}