{"record":{"id":"c7efff26c4322331","repo":"phacility/phabricator","slug":"synchronization-of-parent-task-from-asana-failed","errorCode":null,"errorMessage":"Synchronization of parent task from Asana failed!","messagePattern":"Synchronization of parent task from Asana failed!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php","lineNumber":132,"sourceCode":"    $projects = $this->getAsanaProjectIDs();\n\n    $extra_data = array();\n    if ($main_edge) {\n      $extra_data = $main_edge['data'];\n\n      $refs = id(new DoorkeeperImportEngine())\n        ->setViewer($possessed_user)\n        ->withPHIDs(array($main_edge['dst']))\n        ->execute();\n\n      $parent_ref = head($refs);\n      if (!$parent_ref) {\n        throw new PhabricatorWorkerPermanentFailureException(\n          pht('%s could not be loaded.', 'DoorkeeperExternalObject'));\n      }\n\n      if ($parent_ref->getSyncFailed()) {\n        throw new Exception(\n          pht('Synchronization of parent task from Asana failed!'));\n      } else if (!$parent_ref->getIsVisible()) {\n        $this->log(\n          \"%s\\n\",\n          pht('Skipping main task update, object is no longer visible.'));\n        $extra_data['gone'] = true;\n      } else {\n        $edge_cursor = idx($main_edge['data'], 'cursor', 0);\n\n        // TODO: This probably breaks, very rarely, on 32-bit systems.\n        if ($edge_cursor <= $story->getChronologicalKey()) {\n          $this->log(\"%s\\n\", pht('Updating main task.'));\n          $task_id = $parent_ref->getObjectID();\n\n          $this->makeAsanaAPICall(\n            $oauth_token,\n            'tasks/'.$parent_ref->getObjectID(),\n            'PUT',","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php#L114-L150","documentation":"Before updating the main (parent) Asana task, the worker imports it through DoorkeeperImportEngine and inspects the returned ref. If ref->getSyncFailed() is true — the import engine could not pull the task from the Asana API — this plain Exception is thrown. Because it is a generic Exception rather than a permanent-failure exception, the task queue treats it as a temporary fault and retries the worker later with backoff.","triggerScenarios":"The Asana API request backing the import of the parent task fails: transient 5xx/network errors, rate limiting, an inaccessible workspace, or credentials that fail mid-sync (distinct from the pre-flight token check that produces error 530).","commonSituations":"Asana outage or throttling while a documentation/maniphest story is being mirrored; expired-ish tokens that pass the cached pre-flight but fail the actual fetch; large syncs hitting rate limits.","solutions":["Inspect the daemon log for the underlying Asana API error (`bin/phd log` / daemons console)","If the Asana side is transiently failing, let the worker retry; it re-runs with backoff","If it keeps failing, have related users re-link Asana accounts (see error 530)","As a last resort for a poisoned story, restart the task queue worker to force a fresh attempt"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// In custom worker scaffolding, let plain Exceptions bubble so the queue retries:\ntry {\n  $this->publishToAsana();\n} catch (PhabricatorWorkerPermanentFailureException $ex) {\n  // Permanent: log and stop.\n  phlog($ex);\n  throw $ex;\n}\n// Any other Exception is retried automatically by the worker infrastructure.","preventionTips":["Rely on worker retries for transient Asana API errors; do not convert them to permanent failures","Monitor daemon logs to distinguish rate limiting (retry) from token problems (re-link)","Keep the number of mirrored objects modest to stay under Asana rate limits"],"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"}