{"record":{"id":"39cc691eb2aa8ca2","repo":"phacility/phabricator","slug":"commit-s-with-phid-s-is-no-longer-reachabl","errorCode":null,"errorMessage":"Commit \"%s\" (with PHID \"%s\") is no longer reachable from any branch, tag, or ref in this repository, so it will not be imported. This usually means that the branch the commit was on was deleted or overwritten.","messagePattern":"Commit \"(.+?)\" \\(with PHID \"(.+?)\"\\) is no longer reachable from any branch, tag, or ref in this repository, so it will not be imported\\. This usually means that the branch the commit was on was deleted or overwritten\\.","errorType":"exception","errorClass":"PhabricatorWorkerPermanentFailureException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php","lineNumber":51,"sourceCode":"        }\n      }\n    }\n\n    if (!$commit_phid) {\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht('Task data has no \"commitPHID\".'));\n    }\n\n    $commit = id(clone $commit_query)\n      ->withPHIDs(array($commit_phid))\n      ->executeOne();\n    if (!$commit) {\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht('Commit \"%s\" does not exist.', $commit_phid));\n    }\n\n    if ($commit->isUnreachable()) {\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht(\n          'Commit \"%s\" (with PHID \"%s\") is no longer reachable from any '.\n          'branch, tag, or ref in this repository, so it will not be '.\n          'imported. This usually means that the branch the commit was on '.\n          'was deleted or overwritten.',\n          $commit->getMonogram(),\n          $commit_phid));\n    }\n\n    $this->commit = $commit;\n\n    return $commit;\n  }\n\n  final protected function doWork() {\n    $commit = $this->loadCommit();\n    $repository = $commit->getRepository();\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php#L33-L69","documentation":"loadCommit() checks $commit->isUnreachable() after loading the commit (PhabricatorRepositoryCommitParserWorker.php:50-60). The row exists but is no longer reachable from any branch, tag, or ref; Phabricator deliberately refuses to spend parse effort on unreachable commits and permanently fails the task. This almost always means the branch the commit lived on was deleted or force-pushed away between discovery and parsing.","triggerScenarios":"Force-push rewrites or branch deletion after the commit was discovered but before its parse task ran; quickly-deleted feature branches in busy mirrors; any ref removal that orphans a discovered commit.","commonSituations":"GitHub mirrors where PR branches are deleted immediately after merge; repositories with force-push policies; parse queue lag long enough for branches to disappear first.","solutions":["Usually this is correct behavior - let the task permanently fail, since the commit is garbage in the current repository state","If the commit still matters, restore reachability (push the branch back or revert the force-push), then run bin/repository discover and bin/repository reparse --message --change <commit>","Reduce parse queue lag (more daemon workers) so commits are parsed before their branches are deleted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check reachability before spending effort on a commit.\nif ($commit->isUnreachable()) {\n  // skip; the commit is orphaned by a deleted/rewritten branch\n}","typeGuard":"function isParseableCommit(PhabricatorRepositoryCommit $commit) {\n  return !$commit->isUnreachable();\n}","tryCatchPattern":"try {\n  $commit = $worker->loadCommit();\n} catch (PhabricatorWorkerPermanentFailureException $ex) {\n  // Unreachable commit is expected churn in repos with branch deletion;\n  // log at info level and let the task expire. If the commit matters,\n  // restore the branch, re-discover, and reparse instead of retrying.\n  phlog(pht('Skipping unreachable commit: %s', $ex->getMessage()));\n}","preventionTips":["Expect this failure in mirrors with fast branch deletion; monitor rather than panic","Restore the branch (or revert the force-push) first if the commit must be imported","Keep parse queue lag low so commits parse before their branches vanish"],"tags":["phabricator","git","force-push","deleted-branch","worker-queue","permanent-failure","php"],"backgroundTag":"commit-unreachable","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}