phacility/phabricator · warning · PhutilArgumentUsageException

No source exists with a name matching "%s".

Error message

No source exists with a name matching "%s".

What it means

The fallback case of loadSource()'s empty-result switch: the selector was neither all digits nor a PHID, so it was treated as a human-readable source NAME (name-matching query), and no Nuance source name matched. Note this fires only when zero sources matched — a name matching multiple sources takes the separate 'More than one source matches' branch instead.

Source

Thrown at src/applications/nuance/management/NuanceManagementWorkflow.php:53

      switch ($kind) {
        case 'id':
          $message = pht(
            'No source exists with ID "%s".',
            $source);
          break;
        case 'phid':
          $message = pht(
            'No source exists with PHID "%s".',
            $source);
          break;
        default:
          $message = pht(
            'No source exists with a name matching "%s".',
            $source);
          break;
      }

      throw new PhutilArgumentUsageException($message);
    } else if (count($sources) > 1) {
      $message = pht(
        'More than one source matches "%s". Choose a narrower query, or '.
        'use an ID or PHID to select a source. Matching sources: %s.',
        $source,
        implode(', ', mpull($sources, 'getName')));

      throw new PhutilArgumentUsageException($message);
    }

    return head($sources);
  }

  protected function loadITem(PhutilArgumentParser $argv, $key) {
    $item = $argv->getArg($key);
    if (!strlen($item)) {
      throw new PhutilArgumentUsageException(
        pht(

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. List source names (Nuance UI or list command) and rerun with an exact copy of the name.
  2. Prefer ID or PHID selectors in automation — names are user-editable and drift.
  3. Quote the argument and strip whitespace in scripts: --source "$(printf '%s' "$NAME" | tr -d '[:space:]')" if contamination is possible.
  4. If the source was renamed, update the script to the new name.

Example fix

# before:
# bin/nuance import --source "supportdesk "   # trailing space, no match
# -> err: 'No source exists with a name matching "supportdesk ".'

# after:
# bin/nuance import --source "supportdesk"
Defensive patterns

Strategy: validation

Validate before calling

// For name selectors, match exactly what the query will match:
$trimmed = trim((string)$source_selector);
if ($trimmed !== $source_selector || $trimmed === '') {
  // contaminated selector: normalize before invoking the CLI
}
$exists = id(new NuanceSourceQuery())
  ->setViewer($viewer)
  ->withNames(array($trimmed))
  ->execute();
if (count($exists) === 0) {
  // no such name: fetch the current name list instead of guessing
} elseif (count($exists) > 1) {
  // ambiguous: switch to an ID or PHID selector
}

Prevention

When it happens

Trigger: Running a nuance command with --source <name> where the name query (NuanceSourceQuery with a name constraint) returns empty: typo in the name, wrong case/spelling, renamed source, or whitespace/newline contamination in the shell argument.

Common situations: Renaming sources in the UI and leaving scripts on the old name; freehand typing names instead of copying; trailing newline in $(cat file) style argument construction; names containing emoji/unicode mangled by terminal encoding.

Related errors


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