thanos-io/thanos · critical
create syncer
Error message
create syncer
What it means
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.
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.
Example fix
// before (invalid relabel config passed to syncer filters) --deduplication.replica-label=replica,extra // after --deduplication.replica-label=replica
Defensive patterns
Strategy: validation
Validate before calling
// Validate relabel configs before constructing the syncer
for _, cfg := range relabelConfigs {
if _, err := relabel.ParseConfig(cfg); err != nil {
return fmt.Errorf("invalid relabel config: %w", err)
}
} Try / catch
sy, err := compact.NewSyncer(logger, reg, bkt, fetcher, ..., filters...)
if err != nil {
return fmt.Errorf("create syncer (check relabel/dedup flags and Thanos version): %w", err)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Passing invalid --deduplication.replacement or accept-filter relabel configs, unsupported option combinations after a Thanos upgrade, or a nil logger/registry dependency.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- level is bigger then default set of
- get compaction levels
- initialize query range limits
- create index cache
- unknown sync strategy
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/5462e390ef6dd640.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/thanos/tools_bucket.go:897
block.NewLabelShardedMetaFilter(relabelConfig),
block.NewConsistencyDelayMetaFilter(logger, tbc.consistencyDelay, extprom.WrapRegistererWithPrefix(extpromPrefix, reg)),
ignoreDeletionMarkFilter,
duplicateBlocksFilter,
},
)
sy, err = compact.NewMetaSyncer(
logger,
reg,
insBkt,
cf,
duplicateBlocksFilter,
ignoreDeletionMarkFilter,
stubCounter,
stubCounter,
0,
)
if err != nil {
return errors.Wrap(err, "create syncer")
}
}
level.Info(logger).Log("msg", "syncing blocks metadata")
if err := sy.SyncMetas(ctx); err != nil {
return errors.Wrap(err, "sync blocks")
}
level.Info(logger).Log("msg", "synced blocks done")
compact.BestEffortCleanAbortedPartialUploads(ctx, logger, sy.Partial(), insBkt, stubCounter, stubCounter, stubCounter, ignoreDeletionMarkFilter.DeletionMarkBlocks())
if _, err := blocksCleaner.DeleteMarkedBlocks(ctx); err != nil {
return errors.Wrap(err, "error cleaning blocks")
}
level.Info(logger).Log("msg", "cleanup done")
return nil
})View on GitHub (pinned to 35b8b99117)