{"record":{"id":"cf305221c9138bec","repo":"thanos-io/thanos","slug":"parse-limit-configuration","errorCode":null,"errorMessage":"parse limit configuration","messagePattern":"parse limit configuration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":267,"sourceCode":"\t\tbkt,\n\t\tconf.allowOutOfOrderUpload,\n\t\tconf.skipCorruptedBlocks,\n\t\thashFunc,\n\t\tmultiTSDBOptions...,\n\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,","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L249-L285","documentation":"After successfully reading the limits config content, runReceive parses the YAML into receive.RootLimitsConfig via receive.ParseRootLimitConfig. Any YAML syntax error or schema violation in the limit configuration is wrapped with 'parse limit configuration', aborting startup.","triggerScenarios":"--receive.limits-config points to a file whose content is invalid YAML or violates the RootLimitsConfig schema (wrong field names/types, e.g. a string where a duration or int is expected).","commonSituations":"Hand-edited limits.yaml with indentation mistakes; wrong keys copied from an older Thanos version's schema; durations written as '10s' where raw numbers are expected (or vice versa); tabs instead of spaces.","solutions":["Validate the YAML with a linter (yamllint) or a quick yaml.Unmarshal test to find the syntax error at the reported line.","Compare your config against the RootLimitsConfig schema / example config for your exact Thanos version.","Check field names, types, and duration formats match the schema (e.g. tenantWriteLimits, headSeriesLimit).","Ensure the file was not truncated or merged incorrectly by a templating system (Helm, ConfigMap)."],"exampleFix":"# before (bad: wrong type)\nwriteLimits:\n  headSeriesLimit: \"ten-thousand\"\n# after\nwriteLimits:\n  headSeriesLimit: 10000","handlingStrategy":"validation","validationCode":"var tmp receive.RootLimitsConfig\nif err := yaml.UnmarshalStrict(content, &tmp); err != nil {\n  return fmt.Errorf(\"invalid limits config %s: %w\", limitsPath, err)\n}","typeGuard":null,"tryCatchPattern":"if err := run(); err != nil {\n  if strings.Contains(err.Error(), \"parse limit configuration\") {\n    log.Errorf(\"fix YAML/schema in limits config: %v\", err)\n  }\n}","preventionTips":["Validate limits.yaml in CI with yaml.UnmarshalStrict against RootLimitsConfig","Use spaces not tabs; lint with yamllint","Pin config examples to your Thanos version","Review templated configs after Helm/ConfigMap changes"],"tags":["yaml","configuration","validation","startup"],"backgroundTag":"yaml-parse-error","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"}