phacility/phabricator · warning · PhutilArgumentUsageException

Unable to load specified object ("%s").

Error message

Unable to load specified object ("%s").

What it means

'bin/herald call-webhook --object <name>' resolves the name through PhabricatorObjectQuery::withNames() (monogram lookup, e.g. T123, D45). If the query returns nothing, this usage exception is thrown. When --object is omitted the hook itself is used as the object, so the error only happens with an explicit unresolvable name.

Source

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

      ->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));
      }
      $object = head($objects);
    }

    $is_background = $args->getArg('background');

    $xaction_query =
      PhabricatorApplicationTransactionQuery::newQueryForObject($object);

    $xactions = $xaction_query
      ->withObjectPHIDs(array($object->getPHID()))
      ->setViewer($viewer)
      ->setLimit(10)
      ->execute();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Verify the monogram in the UI and re-run with the corrected name.
  2. Omit --object entirely to fire the hook against the webhook object itself.

Example fix

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

Strategy: validation

Validate before calling

// Resolve the monogram before invoking the workflow:
$objects = id(new PhabricatorObjectQuery())
  ->setViewer($viewer)
  ->withNames(array($object_name))
  ->execute();
if (!$objects) {
  throw new InvalidArgumentException('Unknown object: '.$object_name);
}

Prevention

When it happens

Trigger: Running './bin/herald call-webhook --id 3 --object X999' where X999 is not a valid monogram of an existing object; the referenced object was deleted.

Common situations: Monogram typo or wrong case; scripting against an environment where the object does not exist; object deleted between writing and running the script.

Related errors


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