phacility/phabricator · error · PhutilArgumentUsageException

More than one source matches

Error message

More than one source matches "%s". Choose a narrower query, or use an ID or PHID to select a source. Matching sources: %s.

What it means

Ambiguity error in Nuance source lookup: the selector string (a name query) matched multiple Nuance sources, and the management workflow refuses to guess which one was meant; it lists the matching source names.

Solutions

  1. Narrow the name query so only one source matches
  2. Select the source by numeric ID or PHID instead of by name
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/nuance/management/NuanceManagementWorkflow.php:61 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

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

            '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(
          'Specify a item with %s.',
          '--'.$key));
    }

    $query = id(new NuanceItemQuery())
      ->setViewer($this->getViewer())
      ->setRaisePolicyExceptions(true);

View on GitHub (pinned to 5720a38cfe)