{"record":{"id":"5462e390ef6dd640","repo":"thanos-io/thanos","slug":"create-syncer-5462e3","errorCode":null,"errorMessage":"create syncer","messagePattern":"create syncer","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cmd/thanos/tools_bucket.go","lineNumber":897,"sourceCode":"\t\t\t\t\tblock.NewLabelShardedMetaFilter(relabelConfig),\n\t\t\t\t\tblock.NewConsistencyDelayMetaFilter(logger, tbc.consistencyDelay, extprom.WrapRegistererWithPrefix(extpromPrefix, reg)),\n\t\t\t\t\tignoreDeletionMarkFilter,\n\t\t\t\t\tduplicateBlocksFilter,\n\t\t\t\t},\n\t\t\t)\n\t\t\tsy, err = compact.NewMetaSyncer(\n\t\t\t\tlogger,\n\t\t\t\treg,\n\t\t\t\tinsBkt,\n\t\t\t\tcf,\n\t\t\t\tduplicateBlocksFilter,\n\t\t\t\tignoreDeletionMarkFilter,\n\t\t\t\tstubCounter,\n\t\t\t\tstubCounter,\n\t\t\t\t0,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"create syncer\")\n\t\t\t}\n\t\t}\n\n\t\tlevel.Info(logger).Log(\"msg\", \"syncing blocks metadata\")\n\t\tif err := sy.SyncMetas(ctx); err != nil {\n\t\t\treturn errors.Wrap(err, \"sync blocks\")\n\t\t}\n\n\t\tlevel.Info(logger).Log(\"msg\", \"synced blocks done\")\n\n\t\tcompact.BestEffortCleanAbortedPartialUploads(ctx, logger, sy.Partial(), insBkt, stubCounter, stubCounter, stubCounter, ignoreDeletionMarkFilter.DeletionMarkBlocks())\n\t\tif _, err := blocksCleaner.DeleteMarkedBlocks(ctx); err != nil {\n\t\t\treturn errors.Wrap(err, \"error cleaning blocks\")\n\t\t}\n\n\t\tlevel.Info(logger).Log(\"msg\", \"cleanup done\")\n\t\treturn nil\n\t})","sourceCodeStart":879,"sourceCodeEnd":915,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/tools_bucket.go#L879-L915","documentation":"After building the meta fetcher, compact.NewSyncer assembles the block syncer (including the partitioner and duplicate-block filtering). Failure to construct it is wrapped as 'create syncer'. This is an initialization error, not a data-sync error, and typically indicates invalid configuration handed to NewSyncer.","triggerScenarios":"Running compact/replicate where NewSyncer returns an error at cmd/thanos/tools_bucket.go:897 — e.g. invalid relabel/accept-filters configuration, an invalid block-pick strategy, or a failure creating the underlying partitioner due to bad options.","commonSituations":"Passing invalid --deduplication.replacement or accept-filter relabel configs, unsupported option combinations after a Thanos upgrade, or a nil logger/registry dependency.","solutions":["Inspect the wrapped inner error for which syncer component rejected the options.","Validate any relabel config flags passed to the command with `promtool check config` equivalent relabel rules.","Upgrade/align Thanos version if options changed (check NewSyncer signature/options for your release).","Retry with default options to isolate which custom flag causes the construction failure."],"exampleFix":"// before (invalid relabel config passed to syncer filters)\n--deduplication.replica-label=replica,extra\n// after\n--deduplication.replica-label=replica","handlingStrategy":"validation","validationCode":"// Validate relabel configs before constructing the syncer\nfor _, cfg := range relabelConfigs {\n    if _, err := relabel.ParseConfig(cfg); err != nil {\n        return fmt.Errorf(\"invalid relabel config: %w\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":"sy, err := compact.NewSyncer(logger, reg, bkt, fetcher, ..., filters...)\nif err != nil {\n    return fmt.Errorf(\"create syncer (check relabel/dedup flags and Thanos version): %w\", err)\n}","preventionTips":["Keep custom flags (dedup, replica-label, relabel configs) minimal and tested","Validate relabel config files before passing them","Align the command flags with the exact Thanos version deployed","Retry once with default options to isolate the offending flag"],"tags":["compaction","initialization","config"],"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"}