{"record":{"id":"87a2e6a5ab8aedc4","repo":"thanos-io/thanos","slug":"get-content-of-limit-configuration","errorCode":null,"errorMessage":"get content of limit configuration","messagePattern":"get content of limit configuration","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":263,"sourceCode":"\t\treg,\n\t\ttsdbOpts,\n\t\tlset,\n\t\tconf.tenantLabelName,\n\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,","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L245-L281","documentation":"runReceive loads the optional receive root-limit configuration file through conf.writeLimitsConfig.Content(). If reading the file content fails (unreadable path, permission issue, IO error), the error is wrapped with 'get content of limit configuration' and receive startup aborts.","triggerScenarios":"Starting `thanos receive` with a non-empty --receive.limits-config pointing to a file that cannot be read: missing file, wrong permissions, mount not yet available, or the config provider failing to fetch content.","commonSituations":"Typo in the path passed to --receive.limits-config; Kubernetes ConfigMap volume not mounted yet at container start; file deleted/renamed; permissions restricted for the thanos user.","solutions":["Verify the path given to --receive.limits-config exists and is readable by the thanos process (ls -l / cat it as the same user).","In Kubernetes, ensure the ConfigMap/Secret volume containing limits.yaml is mounted before thanos starts.","Fix file permissions (chmod/chown) or run the container with a user that can read the file.","If limits are not needed, remove --receive.limits-config entirely so this code path is skipped."],"exampleFix":"// before\nthanos receive --receive.limits-config=/etc/thanos/limits.yaml  # file missing\n// after\nthanos receive --receive.limits-config=/etc/thanos/limits.yaml  # after mounting the file at that path","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(limitsPath); err != nil { return fmt.Errorf(\"limits config not readable: %w\", err) }\nif _, err := os.ReadFile(limitsPath); err != nil { return err }","typeGuard":null,"tryCatchPattern":"if err := run(); err != nil {\n  if strings.Contains(err.Error(), \"get content of limit configuration\") {\n    log.Errorf(\"check --receive.limits-config path/mount: %v\", err)\n  }\n}","preventionTips":["Stat/read the limits file in an init container or pre-start check","Ensure ConfigMap volumes are mounted before process start","Run thanos as a user with read permission on config paths","Omit the flag when no limits are needed"],"tags":["configuration","filesystem","startup"],"backgroundTag":"file-read-failed","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"}