phacility/phabricator · warning · PhutilArgumentUsageException

Select a new priority for selected tasks with "--priority".

Error message

Select a new priority for selected tasks with "--priority".

What it means

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.

Source

Thrown at src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementPriorityWorkflow.php:32

      ->setArguments(
        array_merge(
          array(
            array(
              'name' => 'priority',
              'param' => 'int',
              'help' => pht(
                'Set tasks to this priority. Tasks with a smaller priority '.
                'value execute before tasks with a larger priority value.'),
            ),
          ),
          $this->getTaskSelectionArguments()));
  }

  public function execute(PhutilArgumentParser $args) {
    $new_priority = $args->getArg('priority');

    if ($new_priority === null) {
      throw new PhutilArgumentUsageException(
        pht(
          'Select a new priority for selected tasks with "--priority".'));
    }

    $new_priority = (int)$new_priority;
    if ($new_priority <= 0) {
      throw new PhutilArgumentUsageException(
        pht(
          'Priority must be a positive integer.'));
    }

    $tasks = $this->loadTasks($args);

    if (!$tasks) {
      $this->logWarn(
        pht('NO TASKS'),
        pht('No tasks selected to reprioritize.'));

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pass --priority <positive-integer>.
  2. Compare against existing task priorities (bin/worker task listing) to pick a sensible value.

Example fix

# before
bin/worker priority --ids 123
# after
bin/worker priority --ids 123 --priority 100
Defensive patterns

Strategy: validation

Validate before calling

if ($priority === null || (int)$priority <= 0) {
  // require a positive integer --priority before invoking the workflow
}

Prevention

When it happens

Trigger: Running bin/worker priority --ids <n> with no --priority flag at all.

Common situations: Operators exploring worker management commands; scripts whose priority variable is unset and resolves to null.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/f5d9bf11e2a877ff. Report an issue: GitHub.