phacility/phabricator · error · PhutilArgumentUsageException

Specify a item with .

Error message

Specify a item with %s.

What it means

Usage guard in the Nuance management workflow's loadITem helper: the item argument (by key such as 'item') is an empty string, so no Nuance item id/PHID was supplied. The generic helper throws before attempting any database query for the item.

Solutions

  1. Supply a value (item ID or PHID) for the flagged --key argument
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/nuance/management/NuanceManagementWorkflow.php:70 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/6b5a4ef94cc1ae94. Report an issue: GitHub.

Appendix: source

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

      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);

    $type_unknown = PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN;

    if (ctype_digit($item)) {
      $kind = 'id';
      $query->withIDs(array($item));
    } else if (phid_get_type($item) !== $type_unknown) {
      $kind = 'phid';
      $query->withPHIDs($item);
    } else {

View on GitHub (pinned to 5720a38cfe)