phacility/phabricator · error · PhutilArgumentUsageException

Specify either specific factors with "--type", or all…

Error message

Specify either specific factors with "--type", or all factors with "--all-types", but not both.

What it means

Usage guard in the MFA-strip workflow: fires when both --type and --all-types were supplied. The two flags select factor scopes in incompatible ways, so the workflow refuses the ambiguous combination before doing any work.

Solutions

  1. Use either --type <type> or --all-types, not both
  2. Run bin/auth list-factors to see factor type names
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php:95 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php:95

      $users_by_username = mpull($users, null, 'getUsername');
      foreach ($usernames as $username) {
        if (empty($users_by_username[$username])) {
          throw new PhutilArgumentUsageException(
            pht(
              'No user exists with username "%s".',
              $username));
        }
      }
    } else {
      $users = null;
    }

    $types = $args->getArg('type');
    $provider_phids = $args->getArg('provider');
    $all_types = $args->getArg('all-types');
    if ($types && $all_types) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify either specific factors with "--type", or all factors with '.
          '"--all-types", but not both.'));
    } else if ($provider_phids && $all_types) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify either specific factors with "--provider", or all factors '.
          'with "--all-types", but not both.'));
    } else if (!$types && !$all_types && !$provider_phids) {
      throw new PhutilArgumentUsageException(
        pht(
          'Use "--type <type>" or "--provider <phid>" to specify which '.
          'factors to strip, or "--all-types" to strip all factors. '.
          'Use `bin/auth list-factors` to show the available factor types '.
          'or `bin/auth list-mfa-providers` to show available providers.'));
    }

    $type_map = PhabricatorAuthFactor::getAllFactors();

View on GitHub (pinned to 5720a38cfe)