{"record":{"id":"855f74134f91c067","repo":"thanos-io/thanos","slug":"unable-to-parse-objstore-config","errorCode":null,"errorMessage":"unable to parse objstore config","messagePattern":"unable to parse objstore config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/tools_bucket.go","lineNumber":1478,"sourceCode":"\ttbc := &bucketUploadBlocksConfig{}\n\ttbc.registerBucketUploadBlocksFlag(cmd)\n\n\tcmd.Setup(func(g *run.Group, logger log.Logger, reg *prometheus.Registry, _ opentracing.Tracer, _ <-chan struct{}, _ bool) error {\n\t\tif len(tbc.labels) == 0 {\n\t\t\treturn errors.New(\"no external labels configured, uniquely identifying external labels must be configured; see https://thanos.io/tip/thanos/storage.md#external-labels for details.\")\n\t\t}\n\n\t\tlset, err := parseFlagLabels(tbc.labels)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"unable to parse external labels\")\n\t\t}\n\t\tif err := promclient.IsDirAccessible(tbc.path); err != nil {\n\t\t\treturn errors.Wrapf(err, \"unable to access path '%s'\", tbc.path)\n\t\t}\n\n\t\tconfContentYaml, err := objStoreConfig.Content()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"unable to parse objstore config\")\n\t\t}\n\n\t\tbkt, err := client.NewBucket(logger, confContentYaml, component.Upload.String(), nil)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"unable to create bucket\")\n\t\t}\n\n\t\tbkt = objstoretracing.WrapWithTraces(objstore.WrapWithMetrics(bkt, extprom.WrapRegistererWithPrefix(\"thanos_\", reg), bkt.Name()))\n\n\t\ttbcDir, err := os.OpenRoot(tbc.path)\n\t\tif err != nil {\n\t\t\trunutil.CloseWithLogOnErr(logger, bkt, \"bucket client\")\n\t\t\treturn errors.Wrap(err, \"unable to open tbc directory\")\n\t\t}\n\n\t\ts := shipper.New(\n\t\t\tbkt,\n\t\t\ttbcDir,","sourceCodeStart":1460,"sourceCodeEnd":1496,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/tools_bucket.go#L1460-L1496","documentation":"This error is returned by the `thanos tools bucket upload` command when objStoreConfig.Content() fails to produce the object-store configuration YAML. The config content loader validates and renders the --objstore.bucket.config-file (or inline config); a parse/read failure is wrapped here. The command cannot proceed to build a bucket client without valid config YAML.","triggerScenarios":"The --objstore.bucket.config-file points to a missing or unreadable file, the YAML does not match any registered objstore provider schema, or the config was supplied via a flag with empty/malformed content.","commonSituations":"Config file path typo or file not mounted into a container; YAML with wrong indentation; using a provider name that is not compiled in (e.g. s3 misspelled); passing an empty file; referencing env-var interpolation that resolves to nothing.","solutions":["Check the config file exists and is readable at the given path; fix the --objstore.bucket.config-file value","Validate the YAML structure and indentation, especially the top-level provider key (e.g. type: s3) and its nested config","Validate the config against the objstore provider schema docs for the thanos version in use","If using env substitution, verify the variables resolve and the file is not empty"],"exampleFix":"// before (bucket.yaml)\nstorage:\n  s3: ...\n// after\n# bucket.yaml\ntype: S3\nconfig:\n  bucket: my-bucket\n  endpoint: s3.amazonaws.com","handlingStrategy":"validation","validationCode":"data, err := os.ReadFile(cfgPath)\nif err != nil {\n    return fmt.Errorf(\"cannot read objstore config %q: %w\", cfgPath, err)\n}\nvar raw map[string]interface{}\nif err := yaml.Unmarshal(data, &raw); err != nil {\n    return fmt.Errorf(\"invalid YAML in %q: %w\", cfgPath, err)\n}\nif _, ok := raw[\"type\"]; !ok {\n    return fmt.Errorf(\"objstore config missing 'type' key\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate bucket YAML with a YAML linter or `thanos tools bucket verify` before running upload","Keep the config in a mounted secret with a stable, absolute path","Pin a 'type' key matching the exact provider name for your thanos version","Avoid hand-editing YAML in production; use templating with validation"],"tags":["go","yaml","config","thanos"],"backgroundTag":"yaml-parse-error","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"}