{"record":{"id":"1457d4cd0972a190","repo":"thanos-io/thanos","slug":"id-is-not-a-valid-block-ulid-got-v","errorCode":null,"errorMessage":"id is not a valid block ULID, got: %v","messagePattern":"id is not a valid block ULID, got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/tools_bucket.go","lineNumber":1229,"sourceCode":"\t\t\treturn err\n\t\t}\n\t\tvar deletions []metadata.DeletionRequest\n\t\tif len(deletionsYaml) > 0 {\n\t\t\tif err := yaml.Unmarshal(deletionsYaml, &deletions); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tmodifiers = append(modifiers, compactv2.WithDeletionModifier(deletions...))\n\t\t}\n\n\t\tif len(modifiers) == 0 {\n\t\t\treturn errors.New(\"rewrite configuration should be provided\")\n\t\t}\n\n\t\tvar ids []ulid.ULID\n\t\tfor _, id := range tbc.blockIDs {\n\t\t\tu, err := ulid.Parse(id)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Errorf(\"id is not a valid block ULID, got: %v\", id)\n\t\t\t}\n\t\t\tids = append(ids, u)\n\t\t}\n\n\t\tif err := os.RemoveAll(tbc.tmpDir); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := os.MkdirAll(tbc.tmpDir, os.ModePerm); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tctx, cancel := context.WithCancel(context.Background())\n\t\tg.Add(func() error {\n\t\t\tchunkPool := chunkenc.NewPool()\n\t\t\tchangeLog := compactv2.NewChangeLog(io.Discard)\n\t\t\tstubCounter := promauto.With(nil).NewCounter(prometheus.CounterOpts{})\n\t\t\tfor _, id := range ids {\n\t\t\t\t// Delete series from block & modify.","sourceCodeStart":1211,"sourceCodeEnd":1247,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/tools_bucket.go#L1211-L1247","documentation":"Thrown when a block ID passed to `thanos tools bucket rewrite` fails ulid.Parse. Thanos block IDs are ULIDs (26-char, base32, e.g. 01ARZ3NDEKTSV4RRFFQ69G5FAV); any other string format is rejected before any object store access. This is an input validation guard so malformed IDs never reach the store layer.","triggerScenarios":"Passing a non-ULID string in --block-ids / positional IDs: a truncated ID, UUID-style IDs, lowercased ULIDs, IDs with whitespace or quotes, or an empty element in a comma-separated list.","commonSituations":"Copy-pasting a block ID with surrounding characters from a UI or log; confusing Prometheus TSDB directory names with ULIDs; a shell script splitting a comma-separated list incorrectly producing an empty token; lowercasing IDs during shell manipulation.","solutions":["Check each ID matches a 26-character ULID (case-sensitive, e.g. 01ARZ3NDEKTSV4RRFFQ69G5FAV) with `echo <id> | tr -d ' '` and re-run.","List valid IDs with `thanos tools bucket ls --objstore.bucket=...` and copy them directly.","If generating IDs in a script, avoid splitting/transforming them (no lowercase, no trimming quotes)."],"exampleFix":"// before\nthanos tools bucket rewrite --objstore.bucket=b 01arz3ndektsv4rrffq69g5fav\n// after\nthanos tools bucket rewrite --objstore.bucket=b 01ARZ3NDEKTSV4RRFFQ69G5FAV","handlingStrategy":"validation","validationCode":"for _, id := range strings.Split(idsFlag, \",\") {\n    if _, err := ulid.Parse(strings.TrimSpace(id)); err != nil {\n        return fmt.Errorf(\"skipping invalid block id %q\", id)\n    }\n}","typeGuard":"func validULID(s string) bool { _, err := ulid.Parse(s); return err == nil }","tryCatchPattern":null,"preventionTips":["Copy block IDs directly from `thanos tools bucket ls` output","Never lowercase or reformat ULIDs in shell scripts","Trim whitespace/quotes before passing IDs"],"tags":["cli","thanos","ulid","input-validation"],"backgroundTag":"invalid-identifier-format","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"}