phacility/phabricator · error · PhutilArgumentUsageException

Specify one or more repositories to push to mirrors.

Error message

Specify one or more repositories to push to mirrors.

What it means

Usage error from `bin/repository mirror`: `loadLocalRepositories($args, 'repos')` resolved to an empty list. The workflow pushes each repository to its configured mirrors via `PhabricatorRepositoryMirrorEngine`, so it requires explicit repository arguments; note it loads only repositories that have local working copies.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php:29

        pht('Push __repository__ to mirrors.'))
      ->setArguments(
        array(
          array(
            'name' => 'verbose',
            'help' => pht('Show additional debugging information.'),
          ),
          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 push to mirrors.'));
    }

    foreach ($repos as $repo) {
      echo tsprintf(
        "%s\n",
        pht(
          'Pushing "%s" to mirrors...',
          $repo->getDisplayName()));

      $engine = id(new PhabricatorRepositoryMirrorEngine())
        ->setRepository($repo)
        ->setVerbose($args->getArg('verbose'))
        ->pushToMirrors();
    }

    echo tsprintf(

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pass repository callsigns/IDs: `./bin/repository mirror R1 R2`.
  2. To push all mirrors, enumerate repositories (`./bin/repository list`) and pass the full list.
  3. Verify each target actually has mirrors configured (Repository → Mirrors) and a local clone.

Example fix

// before
$ ./bin/repository mirror
[1176] Specify one or more repositories to push to mirrors.

// after
$ ./bin/repository mirror R1 R2
Defensive patterns

Strategy: validation

Validate before calling

REPOS="$(./bin/repository list | awk '{print $1}' | tr '\n' ' ')"
[ -n "${REPOS// /}" ] && ./bin/repository mirror $REPOS

Prevention

When it happens

Trigger: Running `./bin/repository mirror` with no arguments; passing callsigns that do not resolve (or resolve to repositories with no local path, which `loadLocalRepositories` filters out).

Common situations: Operators want a mirror push for everything and omit targets; a typo'd callsign resolves to nothing and looks like the command 'forgot' its arguments.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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