{"record":{"id":"a0e1f9c11dc79dd1","repo":"phacility/phabricator","slug":"you-have-no-accounts-a0e1f9","errorCode":null,"errorMessage":"You have no accounts!","messagePattern":"You have no accounts!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/phortune/query/PhortuneChargeSearchEngine.php","lineNumber":51,"sourceCode":"    return $saved;\n  }\n\n  public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {\n    $query = id(new PhortuneChargeQuery());\n\n    $viewer = $this->requireViewer();\n\n    $account = $this->getAccount();\n    if ($account) {\n      $query->withAccountPHIDs(array($account->getPHID()));\n    } else {\n      $accounts = id(new PhortuneAccountQuery())\n        ->withMemberPHIDs(array($viewer->getPHID()))\n        ->execute();\n      if ($accounts) {\n        $query->withAccountPHIDs(mpull($accounts, 'getPHID'));\n      } else {\n        throw new Exception(pht('You have no accounts!'));\n      }\n    }\n\n    return $query;\n  }\n\n  public function buildSearchForm(\n    AphrontFormView $form,\n    PhabricatorSavedQuery $saved_query) {}\n\n  protected function getURI($path) {\n    $account = $this->getAccount();\n    if ($account) {\n      return $account->getChargeListURI($path);\n    } else {\n      return '/phortune/charge/'.$path;\n    }\n  }","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/phortune/query/PhortuneChargeSearchEngine.php#L33-L69","documentation":"Thrown by PhortuneChargeSearchEngine when it builds a charge query with no account context and the viewer is not a member of any Phortune account. Charge history is per-account data, so the engine refuses to run an unscoped query. The throw happens instead of showing an empty or global listing.","triggerScenarios":"Loading the Phortune charge list (e.g. /phortune/charge/) or invoking PhortuneChargeSearchEngine's query building when getAccount() returns null and the PhortuneAccountQuery for the viewer's memberships returns no results.","commonSituations":"New users browsing Phortune before any account exists; users removed from their last billing account; cron jobs or panels rendering charge queries as a system viewer with no memberships.","solutions":["Create or join a Phortune account, then reload the charge list.","Set an explicit account context on the engine (or a merchant context where supported) before querying.","Pre-check PhortuneAccountQuery->withMemberPHIDs(viewer) in custom controllers and show an account-creation prompt when empty.","Confirm the user is not hitting the page with a different/anonymous session."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$accounts = id(new PhortuneAccountQuery())\n  ->setViewer($viewer)\n  ->withMemberPHIDs(array($viewer->getPHID()))\n  ->execute();\nif (!$accounts) {\n  return new Aphront404Response(); // or prompt account creation\n}\n// safe to build the charge query now","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-check account membership before rendering charge history UI.","Keep at least one billing account per user who needs payment visibility.","Return a helpful prompt instead of letting the engine throw."],"tags":["phortune","phabricator","php","payments","search-engine","account-scope"],"backgroundTag":"missing-payment-account","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}