{"record":{"id":"9b7b5fbd2d01d24c","repo":"phacility/phabricator","slug":"no-related-users-have-linked-asana-accounts","errorCode":null,"errorMessage":"No related users have linked Asana accounts.","messagePattern":"No related users have linked Asana accounts\\.","errorType":"exception","errorClass":"PhabricatorWorkerPermanentFailureException","httpStatus":null,"severity":"error","filePath":"src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php","lineNumber":67,"sourceCode":"    //     revision.\n    //   - Follow: users who are following the object; generally CCs.\n\n    $owner_phid = $publisher->getOwnerPHID($object);\n    $active_phids = $publisher->getActiveUserPHIDs($object);\n    $passive_phids = $publisher->getPassiveUserPHIDs($object);\n    $follow_phids = $publisher->getCCUserPHIDs($object);\n\n    $all_phids = array();\n    $all_phids = array_merge(\n      array($owner_phid),\n      $active_phids,\n      $passive_phids,\n      $follow_phids);\n    $all_phids = array_unique(array_filter($all_phids));\n\n    $phid_aid_map = $this->lookupAsanaUserIDs($all_phids);\n    if (!$phid_aid_map) {\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht('No related users have linked Asana accounts.'));\n    }\n\n    $owner_asana_id = idx($phid_aid_map, $owner_phid);\n    $all_asana_ids = array_select_keys($phid_aid_map, $all_phids);\n    $all_asana_ids = array_values($all_asana_ids);\n\n    // Even if the actor isn't a reviewer, etc., try to use their account so\n    // we can post in the correct voice. If we miss, we'll try all the other\n    // related users.\n\n    $try_users = array_merge(\n      array($data->getAuthorPHID()),\n      array_keys($phid_aid_map));\n    $try_users = array_filter($try_users);\n\n    $access_info = $this->findAnyValidAsanaAccessToken($try_users);\n    list($possessed_user, $possessed_asana_id, $oauth_token) = $access_info;","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php#L49-L85","documentation":"The Asana feed worker publishes Phabricator stories (task/revision updates) to Asana on behalf of related users. It collects the owner, active/passive reviewers, and CCs, maps their PHIDs to linked Asana accounts via lookupAsanaUserIDs(), and throws PhabricatorWorkerPermanentFailureException when that map comes back empty. Permanent failure means the daemon will not retry — the queued story task is dropped, because no linked Asana user exists to publish through.","triggerScenarios":"A feed story whose object's related users (owner + reviewers + subscribers + author-adjacent PHIDs) have zero linked Asana accounts in Phabricator. Fires even if some unrelated users have Asana linked; only related-user linkage counts.","commonSituations":"Enabling the Asana bridge before any of the team has linked accounts under Settings -> External Accounts; a one-person project whose owner never linked Asana; testing with personal test objects where only the admin (not the owner) has a linked account.","solutions":["Have at least one directly related user (owner/reviewer/subscriber) link their Asana account in Settings -> External Accounts","Confirm the Asana auth provider and asana.workspace-id are configured so the linking flow works","If the bridge is unwanted, disable the Doorkeeper Asana feed worker so stories are not queued","Re-trigger publishing by causing a new story on the object after accounts are linked"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Before publishing to Asana, check that at least one related user has a linked account.\n$accounts = id(new PhabricatorExternalAccountQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withAccountTypes(array('asana'))\n  ->withUserPHIDs($all_phids)\n  ->execute();\nif (!$accounts) {\n  // Skip Asana mirroring for this story instead of enqueueing a doomed task.\n  return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Have the owner and active reviewers link Asana accounts before enabling the bridge","Do not rely on admins having linked accounts; only related-user linkage counts","Watch for PhabricatorWorkerPermanentFailureException in daemon logs — those stories are dropped, not retried"],"tags":["phabricator","asana","doorkeeper","integration","worker"],"backgroundTag":"no-linked-oauth-account","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}