{"record":{"id":"1fdb687dd72a1062","repo":"phacility/phabricator","slug":"invalid-path-id","errorCode":null,"errorMessage":"Invalid path ID!","messagePattern":"Invalid path ID!","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/controller/DiffusionInlineCommentController.php","lineNumber":44,"sourceCode":"    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    }\n\n    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()))","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/controller/DiffusionInlineCommentController.php#L26-L62","documentation":"A generic sentinel guard in createComment: the code looks up the repository path row (PhabricatorRepository::TABLE_PATH) by the changeset ID supplied with the request, and queryfx_one returned no row. It fires when the client submits an inline comment request whose path/changeset ID does not exist in the database (stale, forged, or from another repository).","triggerScenarios":"Thrown at src/applications/diffusion/controller/DiffusionInlineCommentController.php:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the changeset/path ID being submitted actually exists for the target commit","Reload the diff view to obtain fresh, valid changeset IDs","Check for mismatched repository or commit context in the request"],"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"}