phacility/phabricator · warning · PhutilArgumentUsageException

Specify a webhook to call with "--id".

Error message

Specify a webhook to call with "--id".

What it means

Usage error from 'bin/herald call-webhook' (HeraldWebhookCallManagementWorkflow) when the command is run without --id. --id is the numeric ID of the Herald webhook to fire and has no default, so the workflow aborts immediately after execute() starts.

Solutions

  1. Find the webhook's numeric ID in the Webhooks UI (Herald > Webhooks, e.g. /webhook/) and pass '--id <id>'.
  2. Combine with --object to fire a test against a real object: './bin/herald call-webhook --id 3 --object T123'.

Example fix

// before
./bin/herald call-webhook
// after
./bin/herald call-webhook --id 3 --object T123
Defensive patterns

Strategy: validation

Validate before calling

// In shell wrappers, fail fast before invoking the workflow:
if [ -z "$WEBHOOK_ID" ]; then
  echo "error: WEBHOOK_ID must be set (numeric webhook id from /webhook/)" >&2
  exit 1
fi
exec ./bin/herald call-webhook --id "$WEBHOOK_ID" --object "$OBJECT"

Prevention

When it happens

Trigger: Running './bin/herald call-webhook' with no --id flag; a wrapper script that conditionally builds the flag and the condition evaluated false.

Common situations: Forgetting the flag in cron/CI scripts; assuming the command prompts interactively; copying the webhook PHID instead of the numeric ID and dropping it when it fails to parse.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src/applications/herald/management/HeraldWebhookCallManagementWorkflow.php:50

            'name' => 'count',
            'param' => 'N',
            'help' => pht('Make a total of __N__ copies of the call.'),
          ),
          array(
            'name' => 'background',
            'help' => pht(
              'Instead of making calls in the foreground, add the tasks '.
              'to the daemon queue.'),
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $viewer = $this->getViewer();

    $id = $args->getArg('id');
    if (!$id) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify a webhook to call with "--id".'));
    }

    $count = $args->getArg('count');
    if ($count === null) {
      $count = 1;
    }

    if ($count <= 0) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specified "--count" must be larger than 0.'));
    }

    $hook = id(new HeraldWebhookQuery())
      ->setViewer($viewer)
      ->withIDs(array($id))

View on GitHub (pinned to 5720a38cfe)