{"record":{"id":"695d694cb8648c0e","repo":"phacility/phabricator","slug":"invalid-commit-phid-s","errorCode":null,"errorMessage":"Invalid commit PHID \"%s\"!","messagePattern":"Invalid commit PHID \"(.+?)\"!","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/controller/DiffusionInlineCommentController.php","lineNumber":27,"sourceCode":"\n  protected function newContainerObject() {\n    return $this->loadCommit();\n  }\n\n  private function getCommitPHID() {\n    return $this->getRequest()->getURIData('phid');\n  }\n\n  private function loadCommit() {\n    $viewer = $this->getViewer();\n    $commit_phid = $this->getCommitPHID();\n\n    $commit = id(new DiffusionCommitQuery())\n      ->setViewer($viewer)\n      ->withPHIDs(array($commit_phid))\n      ->executeOne();\n    if (!$commit) {\n      throw new Exception(pht('Invalid commit PHID \"%s\"!', $commit_phid));\n    }\n\n    return $commit;\n  }\n\n  protected function createComment() {\n    $commit = $this->loadCommit();\n\n    // TODO: Write a real PathQuery object?\n    $path_id = $this->getChangesetID();\n    $path = queryfx_one(\n      id(new PhabricatorRepository())->establishConnection('r'),\n      'SELECT path FROM %T WHERE id = %d',\n      PhabricatorRepository::TABLE_PATH,\n      $path_id);\n    if (!$path) {\n      throw new Exception(pht('Invalid path ID!'));\n    }","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/controller/DiffusionInlineCommentController.php#L9-L45","documentation":"Lookup failure in DiffusionInlineCommentController::loadCommit: the commit PHID taken from the request's URI data does not resolve to any commit visible to the viewer (single-PHID DiffusionCommitQuery returned nothing). Inline comment operations require a valid commit container, so a malformed, nonexistent, or inaccessible PHID aborts the controller.","triggerScenarios":"Thrown at src/applications/diffusion/controller/DiffusionInlineCommentController.php:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the commit PHID in the URL is complete and not mangled (copy the link fresh from the commit page)","Ensure the acting user can see the commit's repository","If the commit was hidden or the link predates a re-import, navigate to the commit directly and retry the comment action"],"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"}