phacility/phabricator · error · Exception

You have no accounts!

Error message

You have no accounts!

What it means

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.

Source

Thrown at src/applications/phortune/query/PhortuneSubscriptionSearchEngine.php:84

      $can_edit = PhabricatorPolicyFilter::hasCapability(
        $viewer,
        $account,
        PhabricatorPolicyCapability::CAN_EDIT);
      if (!$can_edit) {
        throw new Exception(
          pht(
            'You can not query subscriptions for an account you are not '.
            'a member of.'));
      }
      $query->withAccountPHIDs(array($account->getPHID()));
    } else {
      $accounts = id(new PhortuneAccountQuery())
        ->withMemberPHIDs(array($viewer->getPHID()))
        ->execute();
      if ($accounts) {
        $query->withAccountPHIDs(mpull($accounts, 'getPHID'));
      } else {
        throw new Exception(pht('You have no accounts!'));
      }
    }

    return $query;
  }

  public function buildSearchForm(
    AphrontFormView $form,
    PhabricatorSavedQuery $saved_query) {}

  protected function getURI($path) {
    $merchant = $this->getMerchant();
    $account = $this->getAccount();
    if ($merchant) {
      return $merchant->getSubscriptionListURI($path);
    } else if ($account) {
      return $account->getSubscriptionListURI($path);
    } else {

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Create or join a Phortune account, then reload the subscription list.
  2. Scope the engine to an account or merchant the viewer belongs to.
  3. Pre-check account membership in custom code and redirect to account creation when empty.
  4. Audit that the viewer is the intended user (not a logged-out or bot session).
Defensive patterns

Strategy: validation

Validate before calling

$accounts = id(new PhortuneAccountQuery())
  ->setViewer($viewer)
  ->withMemberPHIDs(array($viewer->getPHID()))
  ->execute();
if (!$accounts) {
  return $this->newDialog()->setTitle(pht('You have no accounts!'));
}
// safe to build the subscription query

Prevention

When it happens

Trigger: Loading /phortune/subscription/ (or building its query) where getMerchant() and getAccount() are both null and PhortuneAccountQuery->withMemberPHIDs(array($viewer->getPHID())) returns no rows.

Common situations: 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.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/25b7fb5e431638a7. Report an issue: GitHub.