{"record":{"id":"8a88ed1588f70078","repo":"phacility/phabricator","slug":"synchronization-of-child-task-from-asana-failed","errorCode":null,"errorMessage":"Synchronization of child task from Asana failed!","messagePattern":"Synchronization of child task from Asana failed!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php","lineNumber":274,"sourceCode":"\n    $sub_editor = new PhabricatorEdgeEditor();\n\n    // First, find all the object references in Phabricator for tasks that we\n    // know about and import their objects from Asana.\n    $sub_edges = $edges[$src_phid][$etype_sub];\n    $sub_refs = array();\n    $subtask_data = $this->getAsanaSubtaskData($object);\n    $have_phids = array();\n\n    if ($sub_edges) {\n      $refs = id(new DoorkeeperImportEngine())\n        ->setViewer($possessed_user)\n        ->withPHIDs(array_keys($sub_edges))\n        ->execute();\n\n      foreach ($refs as $ref) {\n        if ($ref->getSyncFailed()) {\n          throw new Exception(\n            pht('Synchronization of child task from Asana failed!'));\n        }\n        if (!$ref->getIsVisible()) {\n          $ref->getExternalObject()->delete();\n          continue;\n        }\n        $have_phids[$ref->getExternalObject()->getPHID()] = $ref;\n      }\n    }\n\n    // Remove any edges in Phabricator which don't have valid tasks in Asana.\n    // These are likely tasks which have been deleted. We're going to respawn\n    // them.\n    foreach ($sub_edges as $sub_phid => $sub_edge) {\n      if (isset($have_phids[$sub_phid])) {\n        continue;\n      }\n","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php#L256-L292","documentation":"While syncing subtasks, the worker imports every Asana object referenced by existing subtask edges and checks each ref. A ref with getSyncFailed() true — the Asana API fetch for that child task failed — triggers this plain Exception. Like error 531 it is a generic Exception, so the task queue retries the whole story worker with backoff rather than dropping it.","triggerScenarios":"Any one of the imported Asana subtask refs reports a failed sync: transient Asana API errors, rate limiting mid-batch, or one inaccessible subtask while others import fine. Note that an invisible (deleted) subtask does NOT throw here — it is deleted locally and skipped; only sync failure throws.","commonSituations":"Objects with many Asana subtasks where one fetch fails mid-batch; Asana throttling during bulk updates; a subtask whose permissions changed so the possessed users cannot fetch it.","solutions":["Check the daemon log to identify which subtask import failed and why","Leave the worker to retry if Asana was transiently failing (this Exception is retried, not permanent)","Fix access on the specific Asana subtask if it is a permissions problem","Remove the stale Phabricator edge to the problematic subtask if it no longer exists"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Same scaffolding as the parent-task case: only permanent failures end the task.\ntry {\n  $this->syncSubtasks();\n} catch (PhabricatorWorkerPermanentFailureException $ex) {\n  phlog($ex);\n  throw $ex;\n}\n// Plain Exceptions (sync failure) are retried with backoff by the worker queue.","preventionTips":["Prune subtask edges for Asana tasks that were deleted to reduce failed imports","Check daemon logs to find which subtask ref failed when a story keeps retrying","Remember the distinction: invisible subtasks are cleaned up silently; sync-failed ones throw and retry"],"tags":["phabricator","asana","doorkeeper","sync","worker","transient"],"backgroundTag":"upstream-sync-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}