{"record":{"id":"c6430ef9e0a7b1a0","repo":"thanos-io/thanos","slug":"receive-lazy-retrieval-max-buffered-responses-mu","errorCode":null,"errorMessage":"--receive.lazy-retrieval-max-buffered-responses must be > 0","messagePattern":"--receive\\.lazy-retrieval-max-buffered-responses must be > 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":366,"sourceCode":"\t\t\tstatusProber.Healthy()\n\t\t\treturn srv.ListenAndServe()\n\t\t}, func(err error) {\n\t\t\tstatusProber.NotReady(err)\n\t\t\tdefer statusProber.NotHealthy(err)\n\n\t\t\tsrv.Shutdown(err)\n\t\t})\n\t}\n\n\tlevel.Debug(logger).Log(\"msg\", \"setting up gRPC server\")\n\t{\n\t\ttlsCfg, err := tls.NewServerConfig(log.With(logger, \"protocol\", \"gRPC\"), conf.grpcConfig.tlsSrvCert, conf.grpcConfig.tlsSrvKey, conf.grpcConfig.tlsSrvClientCA, conf.grpcConfig.tlsMinVersion, conf.grpcConfig.tlsCiphers, conf.grpcConfig.tlsCurves)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"setup gRPC server\")\n\t\t}\n\n\t\tif conf.lazyRetrievalMaxBufferedResponses <= 0 {\n\t\t\treturn errors.New(\"--receive.lazy-retrieval-max-buffered-responses must be > 0\")\n\t\t}\n\t\toptions := []store.ProxyStoreOption{\n\t\t\tstore.WithProxyStoreDebugLogging(debugLogging),\n\t\t\tstore.WithMatcherCache(cache),\n\t\t\tstore.WithoutDedup(),\n\t\t\tstore.WithLazyRetrievalMaxBufferedResponsesForProxy(conf.lazyRetrievalMaxBufferedResponses),\n\t\t}\n\n\t\tproxy := store.NewProxyStore(\n\t\t\tlogger,\n\t\t\treg,\n\t\t\tdbs.TSDBLocalClients,\n\t\t\tcomp,\n\t\t\tlabels.Labels{},\n\t\t\t0,\n\t\t\tstore.LazyRetrieval,\n\t\t\toptions...,\n\t\t)","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L348-L384","documentation":"runReceive enforces that the flag --receive.lazy-retrieval-max-buffered-responses is strictly positive before enabling lazy retrieval proxy options. If the value is <= 0, it returns a plain errors.New('Not ready'... actually '--receive.lazy-retrieval-max-buffered-responses must be > 0') and receive exits at startup. This guard prevents configuring the ProxyStore with a non-positive buffered response limit, which would break lazy retrieval backpressure.","triggerScenarios":"Launching `thanos receive` with --receive.lazy-retrieval-max-buffered-responses set to 0, a negative number, or an unparseable value that left the config field at/negatives zero while lazy retrieval options are being wired into the ProxyStore.","commonSituations":"Operator set the flag to 0 intending to 'disable' lazy retrieval; an automation template rendered an empty or negative value; copy-paste from docs of a different flag.","solutions":["Set --receive.lazy-retrieval-max-buffered-responses to a positive integer (e.g. 1000) on the command line or in your manifest.","Check the templating/automation that renders the flag for empty or negative values.","To disable lazy retrieval, remove the lazy-retrieval related flags instead of setting the buffer to 0."],"exampleFix":"// before\n--receive.lazy-retrieval-max-buffered-responses=0\n// after\n--receive.lazy-retrieval-max-buffered-responses=1000","handlingStrategy":"validation","validationCode":"if v, err := strconv.Atoi(flagValue); err != nil || v <= 0 {\n  return fmt.Errorf(\"--receive.lazy-retrieval-max-buffered-responses must be > 0, got %q\", flagValue)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate rendered manifests for empty/negative numeric flags","To disable lazy retrieval, remove the flags rather than setting 0","Add unit tests on flag-parsing helpers","Review flag defaults after Thanos version upgrades"],"tags":["cli","configuration","validation","startup"],"backgroundTag":"invalid-cli-argument","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"}