{"record":{"id":"67edcb728aa94e4a","repo":"phacility/phabricator","slug":"specified-min-priority-may-not-be-larger-than","errorCode":null,"errorMessage":"Specified \"--min-priority\" may not be larger than specified \"--max-priority\".","messagePattern":"Specified \"--min-priority\" may not be larger than specified \"--max-priority\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php","lineNumber":135,"sourceCode":"    }\n\n    if (($min_failures !== null) || ($max_failures !== null)) {\n      $any_constraints = true;\n      if (($min_failures !== null) && ($max_failures !== null)) {\n        if ($min_failures > $max_failures) {\n          throw new PhutilArgumentUsageException(\n            pht(\n              'Specified \"--min-failures\" must not be larger than '.\n              'specified \"--max-failures\".'));\n        }\n      }\n    }\n\n    if (($min_priority !== null) || ($max_priority !== null)) {\n      $any_constraints = true;\n      if (($min_priority !== null) && ($max_priority !== null)) {\n        if ($min_priority > $max_priority) {\n          throw new PhutilArgumentUsageException(\n            pht(\n              'Specified \"--min-priority\" may not be larger than '.\n              'specified \"--max-priority\".'));\n        }\n      }\n    }\n\n    if (!$any_constraints) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Use constraint flags (like \"--id\" or \"--class\") to select which '.\n          'tasks to affect. Use \"--help\" for a list of supported constraint '.\n          'flags.'));\n    }\n\n    if ($limit !== null) {\n      $limit = (int)$limit;\n      if ($limit <= 0) {","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php#L117-L153","documentation":"Thrown by worker management workflows when `--min-priority` exceeds `--max-priority`. Like the failure bounds, the two flags define an inclusive priority range used to filter tasks; an inverted range matches nothing, so Phabricator fails fast with a usage exception instead of running a no-op command. Requires both bounds to be set.","triggerScenarios":"`./bin/worker archive --min-priority 2000 --max-priority 1000 --class SomeTask`, or `./bin/worker retry --min-priority 9000 --max-priority 100 --active`. Any invocation where the smaller number was intended for both or the flags were reversed.","commonSituations":"Editing an existing command and flipping the two values; scripts deriving the bounds from separate variables; confusion because higher worker priority number means the task runs sooner, leading operators to assume 'min-priority' means 'least important first'.","solutions":["Reorder so min <= max: `--min-priority 1000 --max-priority 2000`","Use one bound alone if a one-sided filter is intended","Add a min<=max assertion in wrapper scripts that template these flags"],"exampleFix":"# before\n./bin/worker archive --min-priority 2000 --max-priority 1000\n\n# after\n./bin/worker archive --min-priority 1000 --max-priority 2000","handlingStrategy":"validation","validationCode":"if ($min_priority !== null && $max_priority !== null\n    && $min_priority > $max_priority) {\n  throw new InvalidArgumentException(\n    sprintf('--min-priority (%d) must not exceed --max-priority (%d)',\n      $min_priority, $max_priority));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember higher worker priority = runs sooner; document that when templating ranges","Unit-test wrapper scripts with inverted ranges to prove they fail before the CLI runs"],"tags":["phabricator","cli","worker-queue","range-validation","argument-validation"],"backgroundTag":"min-max-range-invalid","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}