{"record":{"id":"08b95aa69373f77c","repo":"thanos-io/thanos","slug":"create-data-dir-in-v","errorCode":null,"errorMessage":"create data dir in %v","messagePattern":"create data dir in (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":212,"sourceCode":"\tupload := len(confContentYaml) > 0\n\tif enableIngestion {\n\t\tif upload {\n\t\t\t// The background shipper continuously scans the data directory and uploads\n\t\t\t// new blocks to object storage service.\n\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","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L194-L230","documentation":"Wraps an os.MkdirAll failure while creating the receive local storage directory (conf.dataDir). It fires when the path is not creatable — insufficient permissions, a file occupying the path, or a read-only filesystem — preventing TSDB from storing ingested data.","triggerScenarios":"Thrown at cmd/thanos/receive.go:212 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check directory permissions and ownership","Ensure the parent path exists and is writable","Verify disk space and that the path is not a regular file"],"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"}