{"record":{"id":"13dfcb05d0cb2f89","repo":"phacility/phabricator","slug":"all-members-of-the-account-s-for-this-subscri","errorCode":null,"errorMessage":"All members of the account (\"%s\") for this subscription (\"%s\") are disabled.","messagePattern":"All members of the account \\(\"(.+?)\"\\) for this subscription \\(\"(.+?)\"\\) are disabled\\.","errorType":"exception","errorClass":"PhabricatorWorkerPermanentFailureException","httpStatus":null,"severity":"error","filePath":"src/applications/phortune/worker/PhortuneSubscriptionWorker.php","lineNumber":89,"sourceCode":"        $message = pht(\n          'All members of the account (\"%s\") for this subscription (\"%s\") '.\n          'are disabled.',\n          $account->getPHID(),\n          $subscription->getPHID());\n      } else if ($account->getMemberPHIDs()) {\n        $message = pht(\n          'Unable to load any of the members of the account (\"%s\") for this '.\n          'subscription (\"%s\").',\n          $account->getPHID(),\n          $subscription->getPHID());\n      } else {\n        $message = pht(\n          'The account (\"%s\") for this subscription (\"%s\") has no '.\n          'members.',\n          $account->getPHID(),\n          $subscription->getPHID());\n      }\n      throw new PhabricatorWorkerPermanentFailureException($message);\n    }\n\n    $cart = $account->newCart($actor, $cart_implementation, $merchant);\n\n    $purchase = $cart->newPurchase($actor, $product);\n\n    $purchase\n      ->setBasePriceAsCurrency($currency)\n      ->setMetadataValue('subscriptionPHID', $subscription->getPHID())\n      ->setMetadataValue('epoch.start', $last_epoch)\n      ->setMetadataValue('epoch.end', $next_epoch)\n      ->save();\n\n    $cart\n      ->setSubscriptionPHID($subscription->getPHID())\n      ->setIsInvoice(1)\n      ->save();\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/phortune/worker/PhortuneSubscriptionWorker.php#L71-L107","documentation":"The Phortune subscription billing worker (PhortuneSubscriptionWorker) throws PhabricatorWorkerPermanentFailureException with this message when every member of the subscription's Phortune account is disabled. Automatic billing needs a real, enabled user to act as when creating the invoice cart; with no such member the task fails permanently and will not be retried by the daemon.","triggerScenarios":"A subscription trigger fires for periodic billing while all users returned by PhabricatorPeopleQuery for $account->getMemberPHIDs() have getIsDisabled() true - the worker skips them, finds no actor, and throws.","commonSituations":"Employees disabled during offboarding while their personal accounts still carry active subscriptions; shared team accounts whose every member was deactivated; abandoned test subscriptions on accounts whose members were all banned.","solutions":["Re-enable at least one member of the account (or add an active manager to it) so the next billing trigger finds an actor.","Cancel the subscription if it is no longer wanted, so triggers stop firing and the queue stops accumulating permanent failures.","Move subscriptions to a shared account that always keeps at least one enabled member.","Monitor the daemon task queue for permanent failures to catch this before dunning emails stop going out."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$members = id(new PhabricatorPeopleQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withPHIDs($account->getMemberPHIDs())\n  ->execute();\n$has_actor = false;\nforeach ($members as $member) {\n  if (!$member->getIsDisabled()) {\n    $has_actor = true;\n    break;\n  }\n}\nif (!$has_actor) {\n  // do not rely on automatic billing: fix membership or cancel the subscription\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep at least one enabled manager on every account that carries subscriptions.","Before disabling a user, move their subscriptions to a shared account or cancel them.","Monitor the worker queue for PhabricatorWorkerPermanentFailureException tasks to catch billing stoppages early."],"tags":["phortune","phabricator","php","payments","subscription","billing","worker","user-disabled"],"backgroundTag":"billing-actor-unavailable","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}