{"record":{"id":"1f903e8ea117162f","repo":"phacility/phabricator","slug":"no-accounts-match-the-arguments","errorCode":null,"errorMessage":"No accounts match the arguments!","messagePattern":"No accounts match the arguments!","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php","lineNumber":53,"sourceCode":"\n    $username = $args->getArg('user');\n    if (strlen($username)) {\n      $user = id(new PhabricatorPeopleQuery())\n        ->setViewer($viewer)\n        ->withUsernames(array($username))\n        ->executeOne();\n      if ($user) {\n        $query->withUserPHIDs(array($user->getPHID()));\n      } else {\n        throw new PhutilArgumentUsageException(\n          pht('No such user \"%s\"!', $username));\n      }\n    }\n\n    $accounts = $query->execute();\n\n    if (!$accounts) {\n      throw new PhutilArgumentUsageException(\n        pht('No accounts match the arguments!'));\n    } else {\n      $console->writeOut(\n        \"%s\\n\",\n        pht(\n          'Found %s account(s) to refresh.',\n          phutil_count($accounts)));\n    }\n\n    $providers = PhabricatorAuthProvider::getAllEnabledProviders();\n    $providers = mpull($providers, null, 'getProviderConfigPHID');\n\n    foreach ($accounts as $account) {\n      $console->writeOut(\n        \"%s\\n\",\n        pht(\n          'Refreshing account #%d.',\n          $account->getID()));","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php#L35-L71","documentation":"After applying the --user filter, the PhabricatorExternalAccountQuery (requiring view+edit capabilities) returns no rows: no linked external (OAuth/SSO) accounts match, so the workflow has nothing to refresh and aborts with a usage exception instead of pretending success.","triggerScenarios":"Refreshing a user who never linked an external account; running on an install that uses only password auth (no external accounts exist at all); the operator's viewer lacking edit access to the accounts.","commonSituations":"Running the refresh tool on fresh or password-only installs; testing OAuth wiring before any user has actually linked an account; wrong --user for whom accounts exist.","solutions":["Run './bin/auth refresh' without --user to see whether any external accounts exist at all.","Check the target user's Settings > External Accounts (or Auth > Connected Accounts) to confirm a link exists.","Skip this workflow on installs with no OAuth2 providers — there is nothing to refresh."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify there is anything to refresh before invoking.\n$accounts = id(new PhabricatorExternalAccountQuery())\n  ->setViewer($viewer)\n  ->requireCapabilities(array(\n    PhabricatorPolicyCapability::CAN_VIEW,\n    PhabricatorPolicyCapability::CAN_EDIT,\n  ))\n  ->withUserPHIDs(array($user->getPHID()))\n  ->execute();\nif (!$accounts) {\n  // nothing linked: skip the refresh with an explanatory message\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the user has linked external accounts (Settings > External Accounts) before refreshing.","On password-only installs, skip this workflow entirely.","Run unfiltered once to inventory linked accounts, then add filters."],"tags":["cli","external-accounts","empty-result","phabricator"],"backgroundTag":"no-matching-records","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}