{"record":{"id":"91a5c2e58be70c7c","repo":"thanos-io/thanos","slug":"creating-limiter","errorCode":null,"errorMessage":"creating limiter","messagePattern":"creating limiter","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":272,"sourceCode":"\t)\n\twriter := receive.NewWriter(log.With(logger, \"component\", \"receive-writer\"), dbs, &receive.WriterOptions{\n\t\tTooFarInFutureTimeWindow: int64(time.Duration(*conf.tsdbTooFarInFutureTimeWindow)),\n\t})\n\n\tvar limitsConfig *receive.RootLimitsConfig\n\tif conf.writeLimitsConfig != nil {\n\t\tlimitsContentYaml, err := conf.writeLimitsConfig.Content()\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"get content of limit configuration\")\n\t\t}\n\t\tlimitsConfig, err = receive.ParseRootLimitConfig(limitsContentYaml)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"parse limit configuration\")\n\t\t}\n\t}\n\tlimiter, err := receive.NewLimiter(conf.writeLimitsConfig, reg, receiveMode, log.With(logger, \"component\", \"receive-limiter\"), conf.limitsConfigReloadTimer)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"creating limiter\")\n\t}\n\n\twebHandler := receive.NewHandler(log.With(logger, \"component\", \"receive-handler\"), &receive.Options{\n\t\tWriter:               writer,\n\t\tListenAddress:        conf.rwAddress,\n\t\tRegistry:             reg,\n\t\tEndpoint:             conf.endpoint,\n\t\tTenantHeader:         conf.tenantHeader,\n\t\tTenantField:          conf.tenantField,\n\t\tDefaultTenantID:      conf.defaultTenantID,\n\t\tReplicaHeader:        conf.replicaHeader,\n\t\tReplicationFactor:    conf.replicationFactor,\n\t\tRelabelConfigs:       relabelConfig,\n\t\tReceiverMode:         receiveMode,\n\t\tTracer:               tracer,\n\t\tTLSConfig:            rwTLSConfig,\n\t\tSplitTenantLabelName: conf.splitTenantLabelName,\n\t\tDialOpts:             dialOpts,","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L254-L290","documentation":"runReceive builds the limit enforcement component with receive.NewLimiter, which constructs a reloader tied to the limits config file, Prometheus registry, and reload timer. A failure here (e.g. the limiter cannot set up its config watcher or internal state) is wrapped with 'creating limiter' and receive refuses to start.","triggerScenarios":"Starting `thanos receive` when receive.NewLimiter(conf.writeLimitsConfig, reg, receiveMode, logger, conf.limitsConfigReloadTimer) returns an error — typically because the underlying config content provider fails its initial load or the reload timer/registry setup fails.","commonSituations":"Invalid --receive.limits-config-reload-timer duration value; limiter's initial config fetch failing; internal incompatibility after a Thanos upgrade.","solutions":["Check the wrapped inner error for the precise cause (limiter construction failure).","Verify --receive.limits-config-reload-timer is a valid Go duration (e.g. 3s) if set.","Ensure the limits config file (if provided) is valid and readable so the limiter's initial load succeeds.","Upgrade to a Thanos release where any known NewLimiter initialization bug is fixed."],"exampleFix":"// before\nthanos receive --receive.limits-config-reload-timer=notaduration\n// after\nthanos receive --receive.limits-config-reload-timer=3s","handlingStrategy":"validation","validationCode":"if _, err := time.ParseDuration(reloadTimer); err != nil {\n  return fmt.Errorf(\"invalid --receive.limits-config-reload-timer: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := run(); err != nil {\n  if strings.Contains(err.Error(), \"creating limiter\") {\n    log.Errorf(\"limiter init failed, check config/timer flags: %v\", err)\n  }\n}","preventionTips":["Provide valid Go durations for timer flags","Ensure limits config (if any) passes parsing before limiter creation","Test startup in staging after Thanos upgrades","Read the wrapped inner error for the true cause"],"tags":["configuration","startup","limiter"],"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"}