{"record":{"id":"37bf498beccce5d6","repo":"phacility/phabricator","slug":"err-not-found-37bf49","errorCode":"ERR_NOT_FOUND","errorMessage":"ERR_NOT_FOUND","messagePattern":"ERR_NOT_FOUND","errorType":"error_code","errorClass":"ConduitException","httpStatus":null,"severity":"error","filePath":"src/applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php","lineNumber":40,"sourceCode":"  protected function defineReturnType() {\n    return 'nonempty list<string>';\n  }\n\n  protected function defineErrorTypes() {\n    return array(\n      'ERR_NOT_FOUND' => pht('No such revision exists.'),\n    );\n  }\n\n  protected function execute(ConduitAPIRequest $request) {\n    $id = $request->getValue('revision_id');\n\n    $revision = id(new DifferentialRevisionQuery())\n      ->setViewer($request->getUser())\n      ->withIDs(array($id))\n      ->executeOne();\n    if (!$revision) {\n      throw new ConduitException('ERR_NOT_FOUND');\n    }\n\n    $paths = array();\n    $diff = id(new DifferentialDiff())->loadOneWhere(\n      'revisionID = %d ORDER BY id DESC limit 1',\n      $revision->getID());\n\n    $diff->attachChangesets($diff->loadChangesets());\n\n    foreach ($diff->getChangesets() as $changeset) {\n      $paths[] = $changeset->getFilename();\n    }\n\n    return $paths;\n  }\n\n}\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php#L22-L58","documentation":"Thrown by the differential.getcommitpaths Conduit method. It loads the revision from revision_id with a policy-filtered query; if none is found it throws ConduitException('ERR_NOT_FOUND') (documented as 'No such revision exists.') before listing the filenames of the latest diff's changesets.","triggerScenarios":"Calling differential.getcommitpaths with a nonexistent revision_id, a 'D'-prefixed or null value, or a revision hidden from the acting user.","commonSituations":"Tooling that enumerates touched files for commit hooks or changelogs using IDs harvested from older sources; bots without access to the revision's space; typos in configuration.","solutions":["Pass revision_id as a bare integer verified to exist (differential.query)","Run with a token whose user can see the revision","Treat ERR_NOT_FOUND as a skip condition in batch file-listing jobs","Note the method reads the latest diff only - if you need another diff's paths use differential.getdiff with diff_id"],"exampleFix":"// before\n$params = array('revision_id' => 'D33');\n\n// after\n$params = array('revision_id' => 33);","handlingStrategy":"try-catch","validationCode":"$found = $client->callMethodSynchronous('differential.query',\n  array('ids' => array((int)$rev_id)));\nif (!$found) {\n  return array(); // no revision, no paths\n}","typeGuard":null,"tryCatchPattern":"try {\n  $paths = $client->callMethodSynchronous('differential.getcommitpaths',\n    array('revision_id' => (int)$rev_id));\n} catch (ConduitClientException $ex) {\n  if ($ex->getErrorCode() === 'ERR_NOT_FOUND') {\n    $paths = array();\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Validate revision_id as a positive integer","Skip missing revisions in changelog tooling instead of aborting","Remember the method reflects only the latest diff"],"tags":["phabricator","conduit","differential","not-found","file-listing"],"backgroundTag":"resource-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}