{"record":{"id":"f5b5d0e1b254b6d4","repo":"phacility/phabricator","slug":"err-need-file","errorCode":"ERR-NEED-FILE","errorMessage":"ERR-NEED-FILE","messagePattern":"ERR-NEED-FILE","errorType":"error_code","errorClass":"ConduitException","httpStatus":null,"severity":"error","filePath":"src/applications/differential/conduit/DifferentialCreateInlineConduitAPIMethod.php","lineNumber":83,"sourceCode":"        if (!$diff || $diff->getRevisionID() != $rid) {\n          throw new ConduitException('ERR-BAD-DIFF');\n        }\n      }\n    } else if ($did) {\n      // Given only a diff, find the parent revision.\n      $diff = id(new DifferentialDiff())->load($did);\n      if (!$diff) {\n        throw new ConduitException('ERR-BAD-DIFF');\n      }\n      $rid = $diff->getRevisionID();\n    } else {\n      // Given neither, bail.\n      throw new ConduitException('ERR-NEED-DIFF');\n    }\n\n    $file = $request->getValue('filePath');\n    if (!$file) {\n      throw new ConduitException('ERR-NEED-FILE');\n    }\n    $changes = id(new DifferentialChangeset())->loadAllWhere(\n      'diffID = %d',\n      $did);\n    $cid = null;\n    foreach ($changes as $id => $change) {\n      if ($file == $change->getFilename()) {\n        $cid = $id;\n      }\n    }\n    if ($cid == null) {\n      throw new ConduitException('ERR-BAD-FILE');\n    }\n\n    $inline = id(new DifferentialInlineComment())\n      ->setRevisionID($rid)\n      ->setChangesetID($cid)\n      ->setAuthorPHID($request->getUser()->getPHID())","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/conduit/DifferentialCreateInlineConduitAPIMethod.php#L65-L101","documentation":"Thrown by differential.createinline when the filePath parameter is empty. After resolving the revision and diff, the method loads the diff's changesets and matches them against filePath; an empty value can never match, so it fails fast with ConduitException('ERR-NEED-FILE').","triggerScenarios":"Calling differential.createinline with filePath missing, null, or an empty string - typically when the caller's path variable was never set for a whole-file comment.","commonSituations":"Automated commenters generating one record per finding where some findings have no file; CSV/config rows with empty path columns; refactors that renamed the parameter key.","solutions":["Always send a non-empty filePath string","Skip comment records with no file before making the call","For general (non-inline) feedback, use differential.createcomment with a message instead of an inline with an empty path"],"exampleFix":"// before\n$params = array(\n  'revisionID' => 789,\n  'filePath' => '',\n  'content' => 'General note.',\n);\n\n// after\n// no file: post a normal comment instead\n$client->callMethodSynchronous('differential.createcomment', array(\n  'revision_id' => 789,\n  'message' => 'General note.',\n));","handlingStrategy":"validation","validationCode":"if (!isset($params['filePath']) || !strlen(trim((string)$params['filePath']))) {\n  // no file: downgrade to a plain comment or skip\n  return postPlainComment($params);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reject empty filePath client-side before the call","Map findings without a file to differential.createcomment messages","Log skipped records so silent config gaps surface"],"tags":["phabricator","conduit","differential","inline-comment","missing-parameter"],"backgroundTag":"missing-required-parameter","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}