{"record":{"id":"c79dbcfd3190c067","repo":"phacility/phabricator","slug":"commit-s-does-not-exist-c79dbc","errorCode":null,"errorMessage":"Commit \"%s\" does not exist.","messagePattern":"Commit \"(.+?)\" does not exist\\.","errorType":"exception","errorClass":"PhabricatorWorkerPermanentFailureException","httpStatus":null,"severity":"error","filePath":"src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php","lineNumber":46,"sourceCode":"        $legacy_commit = id(clone $commit_query)\n          ->withIDs(array($commit_id))\n          ->executeOne();\n        if ($legacy_commit) {\n          $commit_phid = $legacy_commit->getPHID();\n        }\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  }","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php#L28-L64","documentation":"The parser worker resolved a commitPHID from the task payload, but DiffusionCommitQuery->withPHIDs(...)->executeOne() returns nothing (PhabricatorRepositoryCommitParserWorker.php:42-48). The commit row does not exist (or never did), so the task is permanently failed and will not be retried.","triggerScenarios":"The repository (and its commits) was deleted while parse tasks were still queued; commit rows were purged by external tooling or a partial DB restore; the task payload references a mistyped or fabricated PHID.","commonSituations":"Deleting a repository with a backlog of parse tasks (tasks outlive the repository until the queue drains); database restores that drop rows but keep the worker queue; hand-built task payloads.","solutions":["Confirm the commit is really gone: query repository_commit by PHID and check whether the repository itself still exists","If the repository was deleted intentionally, let the task expire - the permanent failure is correct","If the row should exist, restore it or re-run discovery (bin/repository discover) to recreate commits, then bin/repository reparse for the affected commits"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm the commit is loadable before scheduling follow-up work.\n$exists = id(new DiffusionCommitQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withPHIDs(array($commit_phid))\n  ->executeOne();\nif (!$exists) {\n  // skip scheduling; the row is gone\n}","typeGuard":"function commitExists($commit_phid) {\n  return (bool)id(new DiffusionCommitQuery())\n    ->setViewer(PhabricatorUser::getOmnipotentUser())\n    ->withPHIDs(array($commit_phid))\n    ->executeOne();\n}","tryCatchPattern":"try {\n  $commit = $worker->loadCommit();\n} catch (PhabricatorWorkerPermanentFailureException $ex) {\n  // Row deleted (e.g., repository removal): archive the task; retrying\n  // cannot succeed until the commit is recreated.\n  phlog($ex);\n}","preventionTips":["Drain or delete repository task queues before deleting a repository","After DB restores, reconcile the worker queue against existing rows","Validate PHIDs sourced from external input before scheduling tasks"],"tags":["phabricator","worker-queue","missing-record","repository-deletion","permanent-failure","php"],"backgroundTag":"missing-database-record","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}