{"record":{"id":"8e1448ba503bb70e","repo":"phacility/phabricator","slug":"failed-to-load-commit","errorCode":null,"errorMessage":"Failed to load commit.","messagePattern":"Failed to load commit\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/controller/DiffusionInlineCommentController.php","lineNumber":65,"sourceCode":"    return id(new PhabricatorAuditInlineComment())\n      ->setCommitPHID($commit->getPHID())\n      ->setPathID($path_id);\n  }\n\n  protected function loadCommentForDone($id) {\n    $viewer = $this->getViewer();\n\n    $inline = $this->loadCommentByID($id);\n    if (!$inline) {\n      throw new Exception(pht('Failed to load comment \"%d\".', $id));\n    }\n\n    $commit = id(new DiffusionCommitQuery())\n      ->setViewer($viewer)\n      ->withPHIDs(array($inline->getCommitPHID()))\n      ->executeOne();\n    if (!$commit) {\n      throw new Exception(pht('Failed to load commit.'));\n    }\n\n    $owner_phid = $commit->getAuthorPHID();\n    $viewer_phid = $viewer->getPHID();\n    $viewer_is_owner = ($owner_phid && ($owner_phid == $viewer_phid));\n    $viewer_is_author = ($viewer_phid == $inline->getAuthorPHID());\n    $is_draft = $inline->isDraft();\n\n    if ($viewer_is_owner) {\n      // You can mark inlines on your own commits as \"Done\".\n    } else if ($viewer_is_author && $is_draft) {\n      // You can mark your own unsubmitted inlines as \"Done\".\n    } else {\n      throw new Exception(\n        pht(\n          'You can not mark this comment as complete: you did not author '.\n          'the commit and the comment is not a draft you wrote.'));\n    }","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/controller/DiffusionInlineCommentController.php#L47-L83","documentation":"A lookup-failure guard in loadCommentForDone: after an inline comment was found, DiffusionCommitQuery could not load the commit identified by the comment's stored commit PHID. It indicates the commit record was destroyed, is in an inaccessible repository, or the PHID is stale/invalid.","triggerScenarios":"Thrown at src/applications/diffusion/controller/DiffusionInlineCommentController.php:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the commit still exists in Phabricator (it may have been destroyed or the repository re-imported)","Check repository policies grant the viewer access to the commit","If the commit was rewritten/imported under a new PHID, discard the stale inline comment"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}