phacility/phabricator · info · PhutilArgumentUsageException

Specify one or more repositories to discover.

Error message

Specify one or more repositories to discover.

What it means

Usage error from 'bin/repository discover': the wildcard 'repos' argument resolved to zero repositories via loadLocalRepositories(). Besides being omitted entirely, names resolve to nothing when callsigns are wrong or the repositories are not local (hosted or observed) repositories eligible for this workflow. The command aborts before starting any discovery engine.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php:34

          ),
          array(
            'name' => 'repair',
            'help' => pht(
              'Discover all commits, even if they are ancestors of known '.
              'commits. This can repair gaps in repository history.'),
          ),
          array(
            'name' => 'repos',
            'wildcard' => true,
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $repos = $this->loadLocalRepositories($args, 'repos');

    if (!$repos) {
      throw new PhutilArgumentUsageException(
        pht('Specify one or more repositories to discover.'));
    }

    $console = PhutilConsole::getConsole();
    foreach ($repos as $repo) {
      $console->writeOut(
        "%s\n",
        pht(
          'Discovering "%s"...',
          $repo->getDisplayName()));

      id(new PhabricatorRepositoryDiscoveryEngine())
        ->setRepository($repo)
        ->setVerbose($args->getArg('verbose'))
        ->setRepairMode($args->getArg('repair'))
        ->discoverCommits();
    }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pass valid repository callsigns or monograms: 'bin/repository discover ABC' (verify on /diffusion/ or via repository search)
  2. Check spelling and case of callsigns
  3. Ensure the repository is set up for local discovery (hosted or observing with a local working copy)

Example fix

# before
bin/repository discover

# after
bin/repository discover ABC
Defensive patterns

Strategy: validation

Validate before calling

// Resolve callsigns to repositories before invoking discover:
$repos = id(new PhabricatorRepositoryQuery())
  ->setViewer($viewer)
  ->withCallsigns($callsigns)
  ->execute();
if (!$repos) {
  fwrite(STDERR, "no matching repositories; check callsigns\n");
  exit(1);
}

Prevention

When it happens

Trigger: Running 'bin/repository discover' bare, or with callsigns that do not exist or contain typos; targeting repositories whose hosting state is not set up for local discovery.

Common situations: Admin runs discover to unstick an import but mistypes the callsign; attempting discovery before the repository record is fully configured.

Related errors


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