{"record":{"id":"f5d9bf11e2a877ff","repo":"phacility/phabricator","slug":"select-a-new-priority-for-selected-tasks-with-p","errorCode":null,"errorMessage":"Select a new priority for selected tasks with \"--priority\".","messagePattern":"Select a new priority for selected tasks with \"--priority\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementPriorityWorkflow.php","lineNumber":32,"sourceCode":"      ->setArguments(\n        array_merge(\n          array(\n            array(\n              'name' => 'priority',\n              'param' => 'int',\n              'help' => pht(\n                'Set tasks to this priority. Tasks with a smaller priority '.\n                'value execute before tasks with a larger priority value.'),\n            ),\n          ),\n          $this->getTaskSelectionArguments()));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $new_priority = $args->getArg('priority');\n\n    if ($new_priority === null) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Select a new priority for selected tasks with \"--priority\".'));\n    }\n\n    $new_priority = (int)$new_priority;\n    if ($new_priority <= 0) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Priority must be a positive integer.'));\n    }\n\n    $tasks = $this->loadTasks($args);\n\n    if (!$tasks) {\n      $this->logWarn(\n        pht('NO TASKS'),\n        pht('No tasks selected to reprioritize.'));\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementPriorityWorkflow.php#L14-L50","documentation":"The worker-management priority workflow re-prioritizes selected tasks and requires a positive integer via --priority; a missing (null) value throws this usage exception before any task is loaded. A separate subsequent check rejects values <= 0 with a different message.","triggerScenarios":"Running bin/worker priority --ids <n> with no --priority flag at all.","commonSituations":"Operators exploring worker management commands; scripts whose priority variable is unset and resolves to null.","solutions":["Pass --priority <positive-integer>.","Compare against existing task priorities (bin/worker task listing) to pick a sensible value."],"exampleFix":"# before\nbin/worker priority --ids 123\n# after\nbin/worker priority --ids 123 --priority 100","handlingStrategy":"validation","validationCode":"if ($priority === null || (int)$priority <= 0) {\n  // require a positive integer --priority before invoking the workflow\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --priority with a positive integer.","Inspect existing task priorities before choosing a value."],"tags":["phabricator","worker-queue","cli","usage"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}