{"record":{"id":"25b7fb5e431638a7","repo":"phacility/phabricator","slug":"you-have-no-accounts-25b7fb","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/PhortuneSubscriptionSearchEngine.php","lineNumber":84,"sourceCode":"      $can_edit = PhabricatorPolicyFilter::hasCapability(\n        $viewer,\n        $account,\n        PhabricatorPolicyCapability::CAN_EDIT);\n      if (!$can_edit) {\n        throw new Exception(\n          pht(\n            'You can not query subscriptions for an account you are not '.\n            'a member of.'));\n      }\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    $merchant = $this->getMerchant();\n    $account = $this->getAccount();\n    if ($merchant) {\n      return $merchant->getSubscriptionListURI($path);\n    } else if ($account) {\n      return $account->getSubscriptionListURI($path);\n    } else {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/phortune/query/PhortuneSubscriptionSearchEngine.php#L66-L102","documentation":"Thrown by PhortuneSubscriptionSearchEngine when there is no merchant and no account context and the viewer is not a member of any Phortune account. Subscriptions always belong to a billing account, so with zero accounts there is nothing valid to query and the engine aborts. This mirrors the 'You have no accounts!' guard in the cart and charge engines.","triggerScenarios":"Loading /phortune/subscription/ (or building its query) where getMerchant() and getAccount() are both null and PhortuneAccountQuery->withMemberPHIDs(array($viewer->getPHID())) returns no rows.","commonSituations":"Newly registered users visiting Phortune before creating an account; accounts deleted or memberships stripped; rendering subscription panels for system/daemon viewers that own no accounts.","solutions":["Create or join a Phortune account, then reload the subscription list.","Scope the engine to an account or merchant the viewer belongs to.","Pre-check account membership in custom code and redirect to account creation when empty.","Audit that the viewer is the intended user (not a logged-out or bot session)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$accounts = id(new PhortuneAccountQuery())\n  ->setViewer($viewer)\n  ->withMemberPHIDs(array($viewer->getPHID()))\n  ->execute();\nif (!$accounts) {\n  return $this->newDialog()->setTitle(pht('You have no accounts!'));\n}\n// safe to build the subscription query","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure a viewer owns or belongs to an account before showing subscription UI.","Pass explicit account context when embedding subscription search.","Handle the no-account case with guidance, not an exception page."],"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"}