phacility/phabricator · warning · PhutilArgumentUsageException
Unable to load specified webhook ("%s").
Error message
Unable to load specified webhook ("%s"). What it means
'bin/herald call-webhook' loads the webhook with HeraldWebhookQuery restricted to withIDs(array($id)) as the CLI admin viewer; when no row matches, this usage exception is thrown. Since the viewer is an admin, the practical cause is that no webhook with that numeric ID exists.
Source
Thrown at src/applications/herald/management/HeraldWebhookCallManagementWorkflow.php:71
}
$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))
->executeOne();
if (!$hook) {
throw new PhutilArgumentUsageException(
pht(
'Unable to load specified webhook ("%s").',
$id));
}
$object_name = $args->getArg('object');
if ($object_name === null) {
$object = $hook;
} else {
$objects = id(new PhabricatorObjectQuery())
->setViewer($viewer)
->withNames(array($object_name))
->execute();
if (!$objects) {
throw new PhutilArgumentUsageException(
pht(
'Unable to load specified object ("%s").',
$object_name));View on GitHub (pinned to 5720a38cfe)
Solutions
- Open the Webhooks console (/webhook/) and use the numeric ID shown there.
- Confirm you are running the command against the correct database/environment.
- If you only have the PHID, look up its numeric ID in the webhook URL or database, then re-run with --id.
Example fix
// before ./bin/herald call-webhook --id 999 --object T123 // after ./bin/herald call-webhook --id 3 --object T123
Defensive patterns
Strategy: validation
Validate before calling
// Verify the webhook exists before shelling out:
$hook = id(new HeraldWebhookQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withIDs(array($id))
->executeOne();
if (!$hook) {
throw new InvalidArgumentException('No webhook with id '.$id);
} Prevention
- Resolve webhook IDs from the live environment (UI or HeraldWebhookQuery) instead of hardcoding per-environment constants.
- Pass the numeric ID from the webhook URL, never the PHID.
When it happens
Trigger: Running './bin/herald call-webhook --id 999' when 999 does not exist; using an ID copied from a different environment; the webhook was deleted after the ID was recorded.
Common situations: Environment mismatch (dev ID used on prod); webhook deleted or recreated with a new ID; passing the PHID (PHID-HWEB-...) where the numeric ID is required.
Related errors
- Unable to load specified object ("%s").
- Specify a webhook to call with "--id".
- Specified "--count" must be larger than 0.
- Unable to load object ("%s") for webhook request ("%s").
- Header has unterminated double quote for key "%s".
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/bcf8683c6dd3c7b4.
Report an issue: GitHub.