{"record":{"id":"084095b189f9051e","repo":"thanos-io/thanos","slug":"validate-config","errorCode":null,"errorMessage":"validate config","messagePattern":"validate config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/store/bucket.go","lineNumber":692,"sourceCode":"\t\tsortingStrategy:                 sortingStrategyStore,\n\t\tindexHeaderLazyDownloadStrategy: indexheader.AlwaysEagerDownloadIndexHeader,\n\t\trequestLoggerFunc:               NoopRequestLoggerFunc,\n\t\tblockLifecycleCallback:          &noopBlockLifecycleCallback{},\n\n\t\tlazyRetrievalMaxBufferedResponses: 20,\n\t}\n\n\tfor _, option := range options {\n\t\toption(s)\n\t}\n\n\t// Depend on the options\n\tindexReaderPoolMetrics := indexheader.NewReaderPoolMetrics(extprom.WrapRegistererWithPrefix(\"thanos_bucket_store_\", s.reg))\n\ts.indexReaderPool = indexheader.NewReaderPool(s.logger, lazyIndexReaderEnabled, lazyIndexReaderIdleTimeout, indexReaderPoolMetrics, s.indexHeaderLazyDownloadStrategy)\n\ts.metrics = newBucketStoreMetrics(s.reg) // TODO(metalmatze): Might be possible via Option too\n\n\tif err := s.validate(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"validate config\")\n\t}\n\n\tif dir == \"\" {\n\t\treturn s, nil\n\t}\n\n\tif err := os.MkdirAll(dir, 0750); err != nil {\n\t\treturn nil, errors.Wrap(err, \"create dir\")\n\t}\n\n\treturn s, nil\n}\n\n// Close the store.\nfunc (s *BucketStore) Close() (err error) {\n\ts.mtx.Lock()\n\tdefer s.mtx.Unlock()\n","sourceCodeStart":674,"sourceCodeEnd":710,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/bucket.go#L674-L710","documentation":"This is not a distinct error but a wrapping context added by NewBucketStore in pkg/store/bucket.go:692. The underlying error (commonly errBlockSyncConcurrencyNotValid or another BucketStore.validate failure) is wrapped with errors.Wrap(err, \"validate config\"), so the final message reads \"validate config: <cause>\".","triggerScenarios":"Calling NewBucketStore with an options object that fails BucketStore.validate() — e.g. blockSyncConcurrency < 1 or other invalid option combinations.","commonSituations":"Thanos Store Gateway / Store component startup with a bad configuration: invalid flags, misconfigured bucket store options, or incompatibilities after a version upgrade changed validation rules.","solutions":["Read the wrapped cause after \"validate config:\" and fix that specific field.","Set blockSyncConcurrency >= 1 and review all BucketStore option values.","Run thanos tools bucket verify or a config lint against your flags before deploying.","Pin schema/flag names to your Thanos version — flags renamed across versions leave zero values behind."],"exampleFix":"// before\nstore, err := storekit.NewBucketStore(logger, reg, bkt, dir, storepb.Ingester_IngestionDisabled)\n// after\nstore, err := storekit.NewBucketStore(logger, reg, bkt, dir, storepb.Ingester_IngestionDisabled,\n    storekit.BlockSyncConcurrency(4))\nif err != nil { return errors.Wrap(err, \"building bucket store\") }","handlingStrategy":"validation","validationCode":"if err := cfg.Validate(); err != nil {\n    return errors.Wrap(err, \"invalid bucket store config\")\n}\nstore, err := NewBucketStore(...)","typeGuard":null,"tryCatchPattern":"store, err := NewBucketStore(...)\nif err != nil {\n    if strings.Contains(err.Error(), \"validate config\") {\n        logger.Error(\"bucket store config invalid\", \"err\", err)\n        os.Exit(1)\n    }\n    return err\n}","preventionTips":["Validate all BucketStore options before NewBucketStore","Pin flag names to your Thanos version","Add config linting to CI"],"tags":["thanos","config","startup"],"backgroundTag":"invalid-config-value","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"}