{"record":{"id":"68b5759071ae74ce","repo":"thanos-io/thanos","slug":"unable-to-create-bucket","errorCode":null,"errorMessage":"unable to create bucket","messagePattern":"unable to create bucket","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/tools_bucket.go","lineNumber":1483,"sourceCode":"\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,\n\t\t\tshipper.WithLogger(logger),\n\t\t\tshipper.WithRegisterer(reg),\n\t\t\tshipper.WithSource(metadata.BucketUploadSource),\n\t\t\tshipper.WithMetaFileName(shipper.DefaultMetaFilename),\n\t\t\tshipper.WithLabels(func() labels.Labels { return lset }),","sourceCodeStart":1465,"sourceCodeEnd":1501,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/tools_bucket.go#L1465-L1501","documentation":"This error is returned when client.NewBucket fails to instantiate the object-storage client from the validated config YAML. NewBucket resolves the provider type and constructs the underlying client (s3, gcs, azure, etc.), failing on unknown providers or client-constructor errors such as bad credentials format. The upload command wraps that failure as 'unable to create bucket'.","triggerScenarios":"objstore config has an unknown/misspelled type (no provider registered under that name), or the provider constructor rejects the config (e.g. invalid endpoint URL, unparsable credentials blob, missing required client option).","commonSituations":"Typo in provider type like 's3s' or 'gcs' vs 'GCS'; endpoint lacking scheme or pointing to a nonexistent host; malformed credentials JSON for GCS; thanos build compiled without the needed objstore provider support.","solutions":["Verify the config 'type' matches an exact supported provider name for your thanos version (S3, GCS, AZURE, COS, OSS, BOS, SWIFT, COS, FILESYSTEM)","Test the same config with a simpler consumer (e.g. thanos tools bucket verify) to surface the underlying constructor error","Check credentials format: GCS requires a service-account JSON path/content; S3 needs valid access/secret keys","If using a custom build, confirm the required objstore provider package is compiled in"],"exampleFix":"// before (bucket.yaml)\ntype: s3s\nconfig:\n  bucket: my-bucket\n// after\n# bucket.yaml\ntype: S3\nconfig:\n  bucket: my-bucket\n  endpoint: s3.amazonaws.com","handlingStrategy":"validation","validationCode":"confContentYaml, err := objStoreConfig.Content()\nif err != nil {\n    return err\n}\n// Probe client construction before the real run:\nif _, err := client.NewBucket(logger, confContentYaml, \"probe\", nil); err != nil {\n    return fmt.Errorf(\"objstore client construction failed: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := runUpload(ctx); err != nil {\n    if strings.Contains(err.Error(), \"unable to create bucket\") {\n        logger.Error(err, \"check provider type and credentials in objstore config\")\n        os.Exit(1)\n    }\n    return err\n}","preventionTips":["Copy provider config examples from the official thanos docs for your exact version","Test the bucket config with `thanos tools bucket verify` before production uploads","Verify provider names are case-correct (S3, GCS, AZURE, ...)","Ensure your thanos build includes the objstore provider you reference"],"tags":["go","object-storage","config","thanos"],"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"}