{"record":{"id":"7b35b4e1d7137d03","repo":"thanos-io/thanos","slug":"invalid-argument-min-time-s-can-t-be-greater","errorCode":null,"errorMessage":"invalid argument: --min-time '%s' can't be greater than --max-time '%s'","messagePattern":"invalid argument: --min-time '(.+?)' can't be greater than --max-time '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/store.go","lineNumber":245,"sourceCode":"\tcmd.Flag(\"bucket-web-label\", \"External block label to use as group title in the bucket web UI\").StringVar(&sc.label)\n\n\tcmd.Flag(\"matcher-cache-size\", \"Max number of cached matchers items. Using 0 disables caching.\").Default(\"0\").IntVar(&sc.matcherCacheSize)\n\n\tcmd.Flag(\"disable-admin-operations\", \"Disable UI/API admin operations like marking blocks for deletion and no compaction.\").Default(\"false\").BoolVar(&sc.disableAdminOperations)\n\n\tsc.reqLogConfig = extkingpin.RegisterRequestLoggingFlags(cmd)\n}\n\n// registerStore registers a store command.\nfunc registerStore(app *extkingpin.App) {\n\tcmd := app.Command(component.Store.String(), \"Store node giving access to blocks in a bucket provider. Now supported GCS, S3, Azure, Swift, Tencent COS and Aliyun OSS.\")\n\n\tconf := &storeConfig{}\n\tconf.registerFlag(cmd)\n\n\tcmd.Setup(func(g *run.Group, logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, _ <-chan struct{}, debugLogging bool) error {\n\t\tif conf.filterConf.MinTime.PrometheusTimestamp() > conf.filterConf.MaxTime.PrometheusTimestamp() {\n\t\t\treturn errors.Errorf(\"invalid argument: --min-time '%s' can't be greater than --max-time '%s'\",\n\t\t\t\tconf.filterConf.MinTime, conf.filterConf.MaxTime)\n\t\t}\n\n\t\thttpLogOpts, err := logging.ParseHTTPOptions(conf.reqLogConfig)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"error while parsing config for request logging\")\n\t\t}\n\n\t\tgrpcLogOpts, logFilterMethods, err := logging.ParsegRPCOptions(conf.reqLogConfig)\n\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"error while parsing config for request logging\")\n\t\t}\n\n\t\tconf.debugLogging = debugLogging\n\n\t\treturn runStore(g,\n\t\t\tlogger,","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/store.go#L227-L263","documentation":"The store command rejects its configuration at Setup time when the --min-time flag value is greater than the --max-time value (both are Prometheus timestamps). The time-range filter would be an empty/contradictory interval, so the process fails fast instead of starting.","triggerScenarios":"Starting `thanos store` with --min-time set to a later timestamp than --max-time, e.g. --min-time=2023-01-01T00:00:00Z with --max-time=2022-12-01T00:00:00Z, or swapped epoch-millisecond values.","commonSituations":"Copy-pasted flag values in the wrong order; scripts computing min/max timestamps with a bug; templating that swaps the values; time-zone mistakes when using absolute date strings.","solutions":["Swap or correct the flag values so --min-time < --max-time.","Use epoch milliseconds consistently (e.g. --min-time=-9223372036854775808 --max-time=9223372036854775807 for unbounded).","Add a pre-launch check in deployment tooling comparing the two parsed timestamps."],"exampleFix":"# before\nthanos store --min-time=2023-01-01T00:00:00Z --max-time=2022-06-01T00:00:00Z\n# after\nthanos store --min-time=2022-06-01T00:00:00Z --max-time=2023-01-01T00:00:00Z","handlingStrategy":"validation","validationCode":"if minTime >= maxTime {\n    return errors.Errorf(\"--min-time %d must be < --max-time %d\", minTime, maxTime)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute min/max timestamps in one place in scripts to avoid swaps.","Lint flag sets in deployment tooling before launch.","Use the sentinel int64 min/max values for unbounded ranges."],"tags":["cli","validation","time-range","thanos-store"],"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"}