{"record":{"id":"61bafa2b794c0a53","repo":"phacility/phabricator","slug":"you-can-only-verify-one-address-at-a-time","errorCode":null,"errorMessage":"You can only verify one address at a time.","messagePattern":"You can only verify one address at a time\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/auth/management/PhabricatorAuthManagementVerifyWorkflow.php","lineNumber":30,"sourceCode":"          'Verify an unverified email address which is already attached to '.\n          'an account. This will also re-execute event hooks for addresses '.\n          'which are already verified.'))\n      ->setArguments(\n        array(\n          array(\n            'name' => 'email',\n            'wildcard' => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $emails = $args->getArg('email');\n    if (!$emails) {\n      throw new PhutilArgumentUsageException(\n        pht('You must specify the email to verify.'));\n    } else if (count($emails) > 1) {\n      throw new PhutilArgumentUsageException(\n        pht('You can only verify one address at a time.'));\n    }\n    $address = head($emails);\n\n    $email = id(new PhabricatorUserEmail())->loadOneWhere(\n      'address = %s',\n      $address);\n    if (!$email) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'No email exists with address \"%s\"!',\n          $address));\n    }\n\n    $viewer = $this->getViewer();\n\n    $user = id(new PhabricatorPeopleQuery())\n      ->setViewer($viewer)","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementVerifyWorkflow.php#L12-L48","documentation":"Thrown by `bin/auth verify` when more than one email address is passed on the command line. Because the 'email' argument is declared 'wildcard', the parser collects all trailing arguments into a list; the workflow enforces count($emails) == 1 with this PhutilArgumentUsageException before processing, since verification is defined as a single-address operation.","triggerScenarios":"Running `bin/auth verify alice@example.com bob@example.com`; a shell glob (e.g. `bin/auth verify *.txt`) or unquoted variable expanding into multiple words; pasting a comma- or space-separated list of addresses.","commonSituations":"An admin tries to bulk-verify a mailing list of addresses in one invocation; a script passes an unquoted `$EMAILS` variable containing several addresses; quoting is lost when the command is copy-pasted through a ticket system.","solutions":["Invoke the workflow once per address: run `bin/auth verify <address>` separately for each one (e.g. in a shell for-loop).","Quote variables and check the argument count in wrapper scripts before calling the command.","If the addresses came from a file, loop over its lines: `while read -r a; do bin/auth verify \"$a\"; done < list.txt`."],"exampleFix":"// before\n$ bin/auth verify alice@example.com bob@example.com\nYou can only verify one address at a time.\n\n// after\n$ for a in alice@example.com bob@example.com; do bin/auth verify \"$a\"; done","handlingStrategy":"validation","validationCode":"// PHP wrapper: enforce the one-address rule before shelling out\nif (count($addresses) !== 1) {\n  throw new Exception('Pass exactly one address per invocation.');\n}\n// shell: always quote\n// bin/auth verify \"{$addresses[0]}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Loop over addresses, one command invocation per address.","Quote every interpolated argument in shell scripts to prevent word-splitting.","Beware unquoted variables and shell globs expanding into multiple arguments."],"tags":["phabricator","cli","email","usage-exception","too-many-arguments"],"backgroundTag":"too-many-arguments","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}