phacility/phabricator · warning · PhutilArgumentUsageException

Argument "%s" does not match the name of any generators.

Error message

Argument "%s" does not match the name of any generators.

What it means

Each argument to 'bin/lipsum generate' is lowercased and matched against generator keys (e.g. 'users'): an exact key match selects that generator, otherwise substring matches are collected (PhabricatorLipsumGenerateWorkflow.php:90-108). This error means the argument matched no generator key even as a substring.

Source

Thrown at src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php:112

      } else {
        $matches = array();
        foreach ($all_generators as $generator) {
          $name = phutil_utf8_strtolower($generator->getGeneratorKey());

          // If there's an exact match, select just that generator.
          if ($arg == $name) {
            $matches = array($generator);
            break;
          }

          // If there's a partial match, match that generator but continue.
          if (strpos($name, $arg) !== false) {
            $matches[] = $generator;
          }
        }

        if (!$matches) {
          throw new PhutilArgumentUsageException(
            pht(
              'Argument "%s" does not match the name of any generators.',
              $arg_original));
        }

        if (count($matches) > 1) {
          throw new PhutilArgumentUsageException(
            pht(
              'Argument "%s" is ambiguous, and matches multiple '.
              'generators: %s.',
              $arg_original,
              implode(', ', mpull($matches, 'getGeneratorName'))));
        }
      }

      foreach ($matches as $match) {
        $generators[] = $match;
      }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Use an exact generator key, e.g. './bin/lipsum generate users'.
  2. Run './bin/lipsum generate all' to run every generator without naming one.
  3. Discover keys from the generator classes (getGeneratorKey()) under src/applications/*/lipsum/.

Example fix

// before
./bin/lipsum generate usres
// after
./bin/lipsum generate users
Defensive patterns

Strategy: validation

Validate before calling

// Resolve generator keys exactly as the workflow does:
$all = id(new PhutilClassMapQuery())
  ->setAncestorClass('PhabricatorTestDataGenerator')
  ->setUniqueMethod('getGeneratorKey')
  ->execute();
$keys = array_map('strtolower', array_keys($all));
if (!in_array(strtolower($arg), $keys, true)) {
  throw new InvalidArgumentException(
    'Unknown generator; valid keys: '.implode(', ', $keys));
}

Type guard

function isLipsumGeneratorKey($arg) {
  static $keys = null;
  if ($keys === null) {
    $keys = array_map('strtolower', array_keys(id(new PhutilClassMapQuery())
      ->setAncestorClass('PhabricatorTestDataGenerator')
      ->setUniqueMethod('getGeneratorKey')
      ->execute()));
  }
  return in_array(strtolower($arg), $keys, true);
}

Prevention

When it happens

Trigger: Running './bin/lipsum generate taks' or any misspelled/invented name; keys changed between Phabricator versions so an old script's argument no longer matches.

Common situations: Guessing generator names instead of using keys; copy-pasting commands for a different version; trailing whitespace or shell quoting issues altering the argument.

Related errors


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