{"record":{"id":"d55a07847f5e6f1b","repo":"thanos-io/thanos","slug":"getting-object-store-config","errorCode":null,"errorMessage":"getting object store config","messagePattern":"getting object store config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cmd/thanos/sidecar.go","lineNumber":140,"sourceCode":"\thttpClient *http.Client,\n\tgrpcLogOpts []grpc_logging.Option,\n\tlogFilterMethods []string,\n) error {\n\n\tvar m = &promMetadata{\n\t\tpromURL: conf.prometheus.url,\n\t\t// Start out with the full time range. The shipper will constrain it later.\n\t\t// TODO(fabxc): minimum timestamp is never adjusted if shipping is disabled.\n\t\tmint: conf.limitMinTime.PrometheusTimestamp(),\n\t\tmaxt: math.MaxInt64,\n\n\t\tlimitMinTime: conf.limitMinTime,\n\t\tclient:       promclient.NewWithTracingClient(logger, httpClient, \"thanos-sidecar\"),\n\t}\n\n\tconfContentYaml, err := conf.objStore.Content()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"getting object store config\")\n\t}\n\n\tvar uploads = len(confContentYaml) != 0\n\tif !uploads {\n\t\tlevel.Info(logger).Log(\"msg\", \"no supported bucket was configured, uploads will be disabled\")\n\t}\n\n\tgrpcProbe := prober.NewGRPC()\n\thttpProbe := prober.NewHTTP()\n\tstatusProber := prober.Combine(\n\t\thttpProbe,\n\t\tgrpcProbe,\n\t\tprober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix(\"thanos_\", reg)),\n\t)\n\n\t// Setup the HTTP server.\n\t{\n\t\tsrv := httpserver.New(logger, reg, comp, httpProbe,","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/sidecar.go#L122-L158","documentation":"The sidecar failed to read/parse the object store configuration file given via --objstore.config-file. Content() re-reads and validates the bucket config YAML from disk on every startup (or config reload), so any disk or YAML problem surfaces wrapped as 'getting object store config'. If this fails, the sidecar cannot determine whether uploads are enabled and aborts startup.","triggerScenarios":"errors.Wrap in runSidecar when conf.objStore.Content() returns an error: the config file path given to --objstore.config-file does not exist, is unreadable (permissions), contains invalid YAML, or fails bucket config validation (e.g. unknown bucket provider in objstore.ParseConfig).","commonSituations":"Kubernetes Secret/ConfigMap not mounted at the expected path; typo'd file path; empty or truncated secret after a bad rollout; unsupported bucket type string like 's3' misspelled; YAML with tabs or wrong indentation.","solutions":["Verify --objstore.config-file points to an existing, readable file (check the mounted Secret/ConfigMap volume)","Validate the YAML with objstore.ValidateConfig (thanos tools bucket verify helpers) or run `thanos sidecar --objstore.config-file=...` to see the underlying parse error","Ensure the bucket provider key (e.g. type: S3) matches a supported provider name for your thanos version","Fix file permissions so the thanos process user can read the file"],"exampleFix":"// before\n- --objstore.config-file=/etc/thanos/objstore.yaml   # file not mounted\n// after\n# ensure the secret is mounted:\nvolumeMounts:\n- name: objstore\n  mountPath: /etc/thanos\n  readOnly: true\n# and objstore.yaml contains:\ntype: S3\nconfig:\n  bucket: thanos\n  ...","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(objstoreCfgPath); err != nil {\n    return fmt.Errorf(\"objstore config file missing: %w\", err)\n}\nif err := objstore.ValidateConfig([]byte(cfgYAML)); err != nil {\n    return fmt.Errorf(\"invalid objstore config: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"cfg, err := conf.objStore.Content()\nif err != nil {\n    return fmt.Errorf(\"objstore config unreadable (%v); check --objstore.config-file mount\", err)\n}","preventionTips":["Mount the objstore Secret/ConfigMap explicitly and add a volume-mount check in init","Validate bucket YAML in CI with objstore.ValidateConfig before deploy","Use readOnly mounts at stable, versioned paths","Pin the bucket provider type string to one supported by your thanos version"],"tags":["config","object-storage","yaml","startup"],"backgroundTag":"config-file-not-found","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"}