phacility/phabricator · error · PhutilArgumentUsageException

Specify one or more repositories to mark imported.

Error message

Specify one or more repositories to mark imported.

What it means

Usage error from `bin/repository mark-imported`: the `repos` wildcard argument resolved to no repositories. The workflow forcibly flips the importing flag on repository objects (optionally back with `--mark-not-imported`), so it requires an explicit target list to avoid mass state changes.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php:28

      ->setSynopsis(pht('Mark __repository__ as imported.'))
      ->setArguments(
        array(
          array(
            'name'        => 'mark-not-imported',
            'help'        => pht('Instead, mark repositories as NOT imported.'),
          ),
          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 mark imported.'));
    }

    $new_importing_value = (bool)$args->getArg('mark-not-imported');

    $console = PhutilConsole::getConsole();
    foreach ($repos as $repo) {
      $name = $repo->getDisplayName();

      if ($repo->isImporting() && $new_importing_value) {
        $console->writeOut(
          "%s\n",
          pht(
            'Repository "%s" is already importing.',
            $name));
      } else if (!$repo->isImporting() && !$new_importing_value) {
        $console->writeOut(
          "%s\n",

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pass repository callsigns/IDs: `./bin/repository mark-imported R1`.
  2. Double-check callsigns resolve (Diffusion or `./bin/repository list`) if arguments were supplied but ignored.
  3. To revert a mistaken mark, run `./bin/repository mark-imported R1 --mark-not-imported`.

Example fix

// before
$ ./bin/repository mark-imported
[1173] Specify one or more repositories to mark imported.

// after
$ ./bin/repository mark-imported R1
Defensive patterns

Strategy: validation

Validate before calling

[ $# -ge 1 ] || { echo 'usage: mark-imported <callsign>... [--mark-not-imported]' >&2; exit 1; }
./bin/repository mark-imported "$@"

Prevention

When it happens

Trigger: Running `./bin/repository mark-imported` bare; passing only `--mark-not-imported` with no repos; identifiers that resolve to nothing.

Common situations: After an import stuck at 99%, operators run the command without specifying which repo; copy-paste loses the trailing callsigns.

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/d4acb70a0422f983. Report an issue: GitHub.