{"record":{"id":"abc447b425ac1a13","repo":"phacility/phabricator","slug":"specify-either-specific-factors-with-type-or","errorCode":null,"errorMessage":"Specify either specific factors with \"--type\", or all factors with \"--all-types\", but not both.","messagePattern":"Specify either specific factors with \"--type\", or all factors with \"--all-types\", but not both\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php","lineNumber":95,"sourceCode":"\n      $users_by_username = mpull($users, null, 'getUsername');\n      foreach ($usernames as $username) {\n        if (empty($users_by_username[$username])) {\n          throw new PhutilArgumentUsageException(\n            pht(\n              'No user exists with username \"%s\".',\n              $username));\n        }\n      }\n    } else {\n      $users = null;\n    }\n\n    $types = $args->getArg('type');\n    $provider_phids = $args->getArg('provider');\n    $all_types = $args->getArg('all-types');\n    if ($types && $all_types) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify either specific factors with \"--type\", or all factors with '.\n          '\"--all-types\", but not both.'));\n    } else if ($provider_phids && $all_types) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify either specific factors with \"--provider\", or all factors '.\n          'with \"--all-types\", but not both.'));\n    } else if (!$types && !$all_types && !$provider_phids) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Use \"--type <type>\" or \"--provider <phid>\" to specify which '.\n          'factors to strip, or \"--all-types\" to strip all factors. '.\n          'Use `bin/auth list-factors` to show the available factor types '.\n          'or `bin/auth list-mfa-providers` to show available providers.'));\n    }\n\n    $type_map = PhabricatorAuthFactor::getAllFactors();","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php#L77-L113","documentation":"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.","triggerScenarios":"Thrown at src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use either --type <type> or --all-types, not both","Run bin/auth list-factors to see factor type names"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}