phacility/phabricator · error · PhutilArgumentUsageException

Specify one or more repositories to find importing commits f

Error message

Specify one or more repositories to find importing commits for.

What it means

Usage error from `bin/repository importing`: the workflow's `repos` wildcard argument captured no repositories, because none were passed on the command line (or none resolved). It lists commits stuck in IMPORTING state via a direct query on `repository_commit`, and needs at least one repository scope to run.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php:30

          'Show commits in __repository__ which are still importing.'))
      ->setArguments(
        array(
          array(
            'name'        => 'simple',
            'help'        => pht('Show simpler output.'),
          ),
          array(
            'name'        => 'repos',
            'wildcard'    => true,
          ),
        ));
  }

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

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

    $repos = mpull($repos, null, 'getID');

    $table = new PhabricatorRepositoryCommit();
    $conn_r = $table->establishConnection('r');

    $rows = queryfx_all(
      $conn_r,
      'SELECT repositoryID, commitIdentifier, importStatus FROM %T
        WHERE repositoryID IN (%Ld)
          AND (importStatus & %d) != %d
          AND (importStatus & %d) != %d',
      $table->getTableName(),
      array_keys($repos),
      PhabricatorRepositoryCommit::IMPORTED_ALL,

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pass one or more repository callsigns/IDs: `./bin/repository importing R1 R2`.
  2. To check every repository, enumerate them first (`./bin/repository list`) and pass the full list.
  3. Verify the callsigns resolve in Diffusion if the list still comes back empty.

Example fix

// before
$ ./bin/repository importing
[1165] Specify one or more repositories to find importing commits for.

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

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: Running `./bin/repository importing` with no arguments; passing only flags; passing identifiers that fail to resolve so `loadRepositories()` returns an empty list.

Common situations: Operators expect the tool to scan all repositories and run it bare; copy-pasted command lost the trailing repo 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/ef53629b01c5f190. Report an issue: GitHub.