phacility/phabricator · warning · PhutilArgumentUsageException

'%s' is not the name of a known object.

Error message

'%s' is not the name of a known object.

What it means

loadPHIDsByNames() resolves the positional object names (like D123, T45) through PhabricatorObjectQuery->withNames() under the CLI viewer. Any name that yields no result in getNamedResults() raises this usage exception naming the offender. Typical causes: typo, wrong monogram prefix, deleted/unpublished object, or an object the acting viewer cannot see.

Source

Thrown at src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php:307

    } else {
      $this->logOkay(
        pht('DONE'),
        pht(
          'Forced search index updates for %s document(s).',
          new PhutilNumber(count($phids))));
    }
  }

  private function loadPHIDsByNames(array $names) {
    $query = id(new PhabricatorObjectQuery())
      ->setViewer($this->getViewer())
      ->withNames($names);
    $query->execute();
    $objects = $query->getNamedResults();

    foreach ($names as $name) {
      if (empty($objects[$name])) {
        throw new PhutilArgumentUsageException(
          pht(
            "'%s' is not the name of a known object.",
            $name));
      }
    }

    return mpull($objects, 'getPHID');
  }

  private function getIndexableObjectsByTypes(array $types) {
    $objects = id(new PhutilClassMapQuery())
      ->setAncestorClass('PhabricatorIndexableInterface')
      ->execute();

    $type_map = array();
    $normal_map = array();
    foreach ($types as $type) {
      $normalized_type = phutil_utf8_strtolower($type);

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Open the monogram in the web UI to confirm it exists and is visible to your account
  2. Fix the typo or prefix in the command
  3. Regenerate name lists immediately before indexing instead of reusing stale ones
  4. When scripting, pre-resolve names via the phid.lookup Conduit method and drop unknowns

Example fix

# before (T999999 does not exist)
bin/search index D123 T999999

# after
bin/search index D123
Defensive patterns

Strategy: validation

Validate before calling

$query = id(new PhabricatorObjectQuery())
  ->setViewer($viewer)
  ->withNames($names);
$query->execute();
$known = $query->getNamedResults();
$unknown = array_diff($names, array_keys($known));
if ($unknown) {
  // skip or fail fast with your own message before running bin/search index
}

Try / catch

try {
  // resolve names / invoke index workflow
} catch (PhutilArgumentUsageException $ex) {
  // message names the exact unknown object; drop it and re-run
}

Prevention

When it happens

Trigger: `bin/search index D12x` (typo), a monogram of a deleted object, an object name the administrative viewer has no policy visibility on, or a name format the object-name parser does not understand.

Common situations: Script-generated lists containing typos or stale monograms (object deleted between list generation and indexing); mixing PHIDs and monograms; wrong application prefix (e.g. M vs T for tasks depending on install).

Related errors


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