phacility/phabricator · error · PhutilArgumentUsageException

Specify either "--start" or "--stop", but not both.

Error message

Specify either "--start" or "--stop", but not both.

What it means

Usage error from `bin/repository maintenance`: both `--start <message>` and `--stop` were supplied at once. The two modes are mutually exclusive because they write opposite values (message vs null) to the repository's maintenance configuration, so the workflow aborts before any write.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementMaintenanceWorkflow.php:56

    $repositories = $this->loadRepositories($args, 'repositories');
    if (!$repositories) {
      throw new PhutilArgumentUsageException(
        pht('Specify one or more repositories to act on.'));
    }

    $message = $args->getArg('start');
    $is_start = (bool)strlen($message);
    $is_stop = $args->getArg('stop');

    if (!$is_start && !$is_stop) {
      throw new PhutilArgumentUsageException(
        pht(
          'Use "--start <message>" to put repositories into maintenance '.
          'mode, or "--stop" to take them out of maintenance mode.'));
    }

    if ($is_start && $is_stop) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify either "--start" or "--stop", but not both.'));
    }

    $content_source = $this->newContentSource();
    $diffusion_phid = id(new PhabricatorDiffusionApplication())->getPHID();

    if ($is_start) {
      $new_value = $message;
    } else {
      $new_value = null;
    }

    foreach ($repositories as $repository) {
      $xactions = array();

      $xactions[] = $repository->getApplicationTransactionTemplate()
        ->setTransactionType(

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Remove one of the flags — start to enter, stop to leave maintenance mode.
  2. In scripts, build the flag list exclusively (`MODE=(--start "$MSG")` or `MODE=(--stop)`, then use `"${MODE[@]}"`).

Example fix

// before
$ ./bin/repository maintenance R1 --start "msg" --stop
[1172] Specify either "--start" or "--stop", but not both.

// after
$ ./bin/repository maintenance R1 --stop
Defensive patterns

Strategy: validation

Validate before calling

if [ "$ACTION" = start ]; then flags=(--start "$MSG"); else flags=(--stop); fi
./bin/repository maintenance "$@" "${flags[@]}"

Prevention

When it happens

Trigger: Running `./bin/repository maintenance R1 --start "msg" --stop`; a wrapper script accumulates flags and ends up passing both from previous invocations.

Common situations: Copy-paste editing of a previous command leaves the old flag in place; automation templates concatenate a default `--stop` with an operator-supplied `--start`.

Related errors


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