phacility/phabricator · warning · PhutilArgumentUsageException

No such object '%s'!

Error message

No such object '%s'!

What it means

After the single object name is resolved with PhabricatorObjectQuery::withNames, a null result throws this usage exception naming the input. Resolution happens under the workflow's viewer, so an object that exists but is invisible to that viewer behaves exactly like one that does not exist.

Source

Thrown at src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php:42

    $obj_names = $args->getArg('objects');
    if (!$obj_names) {
      throw new PhutilArgumentUsageException(
        pht('Specify the name of an object to show policy information for.'));
    } else if (count($obj_names) > 1) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify the name of exactly one object to show policy information '.
          'for.'));
    }

    $object = id(new PhabricatorObjectQuery())
      ->setViewer($viewer)
      ->withNames($obj_names)
      ->executeOne();

    if (!$object) {
      $name = head($obj_names);
      throw new PhutilArgumentUsageException(
        pht(
          "No such object '%s'!",
          $name));
    }

    $handle = id(new PhabricatorHandleQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($object->getPHID()))
      ->executeOne();

    $policies = PhabricatorPolicyQuery::loadPolicies(
      $viewer,
      $object);

    $console->writeOut("__%s__\n\n", pht('OBJECT'));
    $console->writeOut("  %s\n", $handle->getFullName());
    $console->writeOut("\n");

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Verify the name resolves first: ./bin/phid lookup T123
  2. Re-check the monogram for typos and re-run with the exact name.
  3. If the object exists but is hidden, run the command with a viewer that can see the object.

Example fix

# before
./bin/policy show T9999
# after
./bin/phid lookup T123   # confirm it resolves, then
./bin/policy show T123
Defensive patterns

Strategy: validation

Validate before calling

name='T123'
out=$(./bin/phid lookup "$name")
[ -n "$out" ] || { echo "unknown object: $name" >&2; exit 1; }
./bin/policy show "$name"

Prevention

When it happens

Trigger: Running ./bin/policy show T99999 with a misspelled or nonexistent monogram or PHID, or naming an object the executing viewer cannot see.

Common situations: Typos in monograms, objects deleted between copy and paste, and PHIDs copied from another install.

Related errors


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