{"record":{"id":"d65108b1f29ab875","repo":"phacility/phabricator","slug":"maximum-page-size-for-conduit-api-method-calls-is","errorCode":null,"errorMessage":"Maximum page size for Conduit API method calls is 100, but this call specified %s.","messagePattern":"Maximum page size for Conduit API method calls is 100, but this call specified (.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/search/engine/PhabricatorApplicationSearchEngine.php","lineNumber":1381,"sourceCode":"  }\n\n  private function setPagerLimitForConduit($pager, ConduitAPIRequest $request) {\n    $limit = $request->getValue('limit');\n\n    // If there's no limit specified and the query uses a weird huge page\n    // size, just leave it at the default gigantic page size. Otherwise,\n    // make sure it's between 1 and 100, inclusive.\n\n    if ($limit === null) {\n      if ($pager->getPageSize() >= 0xFFFF) {\n        return;\n      } else {\n        $limit = 100;\n      }\n    }\n\n    if ($limit > 100) {\n      throw new Exception(\n        pht(\n          'Maximum page size for Conduit API method calls is 100, but '.\n          'this call specified %s.',\n          $limit));\n    }\n\n    if ($limit < 1) {\n      throw new Exception(\n        pht(\n          'Minimum page size for API searches is 1, but this call '.\n          'specified %s.',\n          $limit));\n    }\n\n    $pager->setPageSize($limit);\n  }\n\n  private function setPagerOffsetsForConduit(","sourceCodeStart":1363,"sourceCodeEnd":1399,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/search/engine/PhabricatorApplicationSearchEngine.php#L1363-L1399","documentation":"setPagerSizeForConduit() caps 'limit' for generated Conduit search methods at 100 results per page (it also silently treats >= 0xFFFF pagesize as 'unlimited internal query'). Requesting limit > 100 throws immediately instead of running a query the caller cannot rely on. Pagination beyond 100 uses 'after' cursors, not bigger limits.","triggerScenarios":"Calling `<app>.search` with `\"limit\": 500` (or any value 101+); also custom code invoking buildQueryFromRequest on an engine with a large limit parameter. Default when limit is null is 100 unless the pager already carries the giant internal page size.","commonSituations":"Scripts ported from the old `<app>.query` methods that pulled hundreds of rows in one call; users trying to export all tasks at once; integrations sizing limit from a config constant that drifted above 100.","solutions":["Set limit <= 100 (e.g. 100) and paginate with the 'after' cursor returned in the response until 'cursor.after' is null.","For full exports, loop: fetch 100, pass response cursor.after as request after, repeat; respect rate/sleep between pages.","If you genuinely need everything server-side, use a dedicated export/reporting path rather than Conduit search pagination.","Do not attempt to raise the cap - it is a hard API contract in the engine."],"exampleFix":"// before\n$after = null;\ndo {\n  $r = conduit('maniphest.search', array('limit' => 1000));\n  ...\n} while (false);\n\n// after\n$after = null;\ndo {\n  $r = conduit('maniphest.search', array('limit' => 100, 'after' => $after));\n  $after = idxv($r, array('cursor', 'after'));\n} while ($after);","handlingStrategy":"validation","validationCode":"$params['limit'] = max(1, min(100, (int)$requested_limit));","typeGuard":"function isValidConduitLimit($n) { return is_int($n) && $n >= 1 && $n <= 100; }","tryCatchPattern":"try {\n  $page = $client->call('maniphest.search', $params);\n} catch (Exception $ex) {\n  if (strpos($ex->getMessage(), 'Maximum page size') !== false) {\n    $params['limit'] = 100;\n    $page = $client->call('maniphest.search', $params);\n  }\n}","preventionTips":["Clamp limits at the API client wrapper so callers cannot exceed 100","Design integrations around cursor pagination from day one","Never port old *.query batch sizes into *.search limits"],"tags":["phabricator","conduit","search","pagination","limit-exceeded"],"backgroundTag":"pagination-limit-exceeded","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}