phacility/phabricator · warning · PhutilArgumentUsageException

No such object "%s" exists!

Error message

No such object "%s" exists!

What it means

After resolving the supplied names through PhabricatorObjectQuery, any name with no entry in getNamedResults() triggers this usage exception. The name either does not exist, is malformed, or resolves to nothing visible to the administrative viewer.

Source

Thrown at src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php:42

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

    $object_names = $args->getArg('objects');
    if (!$object_names) {
      throw new PhutilArgumentUsageException(
        pht('Specify one or more objects to destroy.'));
    }

    $object_query = id(new PhabricatorObjectQuery())
      ->setViewer($this->getViewer())
      ->withNames($object_names);

    $object_query->execute();

    $named_objects = $object_query->getNamedResults();
    foreach ($object_names as $object_name) {
      if (empty($named_objects[$object_name])) {
        throw new PhutilArgumentUsageException(
          pht('No such object "%s" exists!', $object_name));
      }
    }

    foreach ($named_objects as $object_name => $object) {
      if (!($object instanceof PhabricatorDestructibleInterface)) {
        throw new PhutilArgumentUsageException(
          pht(
            'Object "%s" can not be destroyed (it does not implement %s).',
            $object_name,
            'PhabricatorDestructibleInterface'));
      }
    }

    $banner = <<<EOBANNER
                                  uuuuuuu
                               uu###########uu
                            uu#################uu

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Verify the object exists and is visible to the acting user (open its monogram URI in the web UI as that user)
  2. Correct the monogram/PHID spelling and rerun
  3. Run the command as an administrator (for example with --as) who can see the object

Example fix

# before
./bin/remove destroy T999999x

# after: confirm the object resolves in the UI, then destroy
# (open /T123 as the same user first)
./bin/remove destroy T123
Defensive patterns

Strategy: validation

Validate before calling

// Resolve names exactly like the workflow does, before destroying.
$query = id(new PhabricatorObjectQuery())
  ->setViewer($viewer)
  ->withNames($names);
$query->execute();
$missing = array_diff($names, array_keys($query->getNamedResults()));
if ($missing) {
  // report and stop; do not proceed to destroy
}

Prevention

When it happens

Trigger: Passing a monogram or PHID that fails to resolve: a typo'd monogram, a wrong PHID type prefix, an already-destroyed object, or an object hidden from the acting user by policy.

Common situations: Copy-pasted PHIDs truncated in transit; objects destroyed by a previous run; CLI executed as a user who cannot see the target object.

Related errors


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