phacility/phabricator · info · PhutilArgumentUsageException

Use the '%s' flag to specify one or more messages to resend.

Error message

Use the '%s' flag to specify one or more messages to resend.

What it means

'bin/mail resend' re-queues previously sent messages identified by one or more --id flags. The workflow checked $args->getArg('id') first, found none, and halted with this PhutilArgumentUsageException before loading anything.

Source

Thrown at src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php:28

      ->setExamples(
        '**resend** --id 1 --id 2')
      ->setArguments(
        array(
          array(
            'name'    => 'id',
            'param'   => 'id',
            'help'    => pht('Send mail with a given ID again.'),
            'repeat'  => true,
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $console = PhutilConsole::getConsole();

    $ids = $args->getArg('id');
    if (!$ids) {
      throw new PhutilArgumentUsageException(
        pht(
          "Use the '%s' flag to specify one or more messages to resend.",
          '--id'));
    }

    $messages = id(new PhabricatorMetaMTAMail())->loadAllWhere(
      'id IN (%Ld)',
      $ids);

    if ($ids) {
      $ids = array_fuse($ids);
      $missing = array_diff_key($ids, $messages);
      if ($missing) {
        throw new PhutilArgumentUsageException(
          pht(
            'Some specified messages do not exist: %s',
            implode(', ', array_keys($missing))));
      }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Add one or more --id flags with mail IDs: ./bin/mail resend --id 12 --id 34.
  2. Get the IDs from the Outbound Mail web UI (MetaMTA application) or your mail logs.
  3. Afterwards, watch delivery in the mail UI / daemon log to confirm the resend worked.

Example fix

# before
./bin/mail resend

# after
./bin/mail resend --id 12 --id 34
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Running ./bin/mail resend without --id; misspelling the flag; scripts that assemble the command and pass the IDs some other way.

Common situations: Retrying a failed or stuck send after fixing the mailer; first use of the workflow.

Related errors


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