{"record":{"id":"a44f4ac5d877badd","repo":"thanos-io/thanos","slug":"unknown-sync-strategy-s","errorCode":null,"errorMessage":"unknown sync strategy %s","messagePattern":"unknown sync strategy (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/compact.go","lineNumber":246,"sourceCode":"\t// While fetching blocks, we filter out blocks that were marked for deletion by using IgnoreDeletionMarkFilter.\n\t// The delay of deleteDelay/2 is added to ensure we fetch blocks that are meant to be deleted but do not have a replacement yet.\n\t// This is to make sure compactor will not accidentally perform compactions with gap instead.\n\tignoreDeletionMarkFilter := block.NewIgnoreDeletionMarkFilter(logger, insBkt, deleteDelay/2, conf.blockMetaFetchConcurrency)\n\tduplicateBlocksFilter := block.NewDeduplicateFilter(conf.blockMetaFetchConcurrency)\n\tnoCompactMarkerFilter := compact.NewGatherNoCompactionMarkFilter(logger, insBkt, conf.blockMetaFetchConcurrency)\n\tnoDownsampleMarkerFilter := downsample.NewGatherNoDownsampleMarkFilter(logger, insBkt, conf.blockMetaFetchConcurrency)\n\tlabelShardedMetaFilter := block.NewLabelShardedMetaFilter(relabelConfig, conf.dedupReplicaLabels...)\n\tconsistencyDelayMetaFilter := block.NewConsistencyDelayMetaFilter(logger, conf.consistencyDelay, extprom.WrapRegistererWithPrefix(\"thanos_\", reg))\n\ttimePartitionMetaFilter := block.NewTimePartitionMetaFilter(conf.filterConf.MinTime, conf.filterConf.MaxTime)\n\n\tvar blockLister block.Lister\n\tswitch syncStrategy(conf.blockListStrategy) {\n\tcase concurrentDiscovery:\n\t\tblockLister = block.NewConcurrentLister(logger, insBkt)\n\tcase recursiveDiscovery:\n\t\tblockLister = block.NewRecursiveLister(logger, insBkt)\n\tdefault:\n\t\treturn errors.Errorf(\"unknown sync strategy %s\", conf.blockListStrategy)\n\t}\n\tbaseMetaFetcher, err := block.NewBaseFetcher(logger, conf.blockMetaFetchConcurrency, insBkt, blockLister, conf.dataDir, extprom.WrapRegistererWithPrefix(\"thanos_\", reg))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create meta fetcher\")\n\t}\n\n\tenableVerticalCompaction := conf.enableVerticalCompaction\n\tdedupReplicaLabels := strutil.ParseFlagLabels(conf.dedupReplicaLabels)\n\tif len(dedupReplicaLabels) > 0 {\n\t\tenableVerticalCompaction = true\n\t\tlevel.Info(logger).Log(\n\t\t\t\"msg\", \"deduplication.replica-label specified, enabling vertical compaction\", \"dedupReplicaLabels\", strings.Join(dedupReplicaLabels, \",\"),\n\t\t)\n\t}\n\tif enableVerticalCompaction {\n\t\tlevel.Info(logger).Log(\n\t\t\t\"msg\", \"vertical compaction is enabled\", \"compact.enable-vertical-compaction\", fmt.Sprintf(\"%v\", conf.enableVerticalCompaction),\n\t\t)","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/compact.go#L228-L264","documentation":"runCompact validates conf.blockListStrategy against the known strategies (concurrentDiscovery or recursiveDiscovery). Any other value fails fast before any bucket work starts. It is a plain errors.Errorf naming the invalid strategy.","triggerScenarios":"Passing --block-list-strategy with a value other than \"concurrent\" or \"recursive\" (typos, empty string, old values like \"batch\" removed in later versions).","commonSituations":"Config typos in Kubernetes manifests/systemd units; copying flags from an older Thanos version where the strategy set differed; leaving the flag with a blank value.","solutions":["Set --block-list-strategy=concurrent or recursive.","Omit the flag to use the default strategy.","Check `thanos compact --help` for the exact accepted values."],"exampleFix":"// before\n--block-list-strategy=parallel\n// after\n--block-list-strategy=concurrent","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"concurrent\": true, \"recursive\": true}\nif !valid[blockListStrategy] {\n    return fmt.Errorf(\"block-list-strategy must be concurrent|recursive, got %q\", blockListStrategy)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only flag values listed in `thanos compact --help`","Pin and review Thanos version when copying flags between deployments","Validate deploy manifests (lint for unknown flag values) before rollout"],"tags":["cli","enum-validation","config"],"backgroundTag":"invalid-enum-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"}