{"record":{"id":"5f921543b775591b","repo":"phacility/phabricator","slug":"edge-type-s-is-not-a-recognized-edge-type","errorCode":null,"errorMessage":"Edge type \"%s\" is not a recognized edge type.","messagePattern":"Edge type \"(.+?)\" is not a recognized edge type\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/edges/conduit/EdgeSearchConduitAPIMethod.php","lineNumber":109,"sourceCode":"            'not have permission to view it.',\n            $phid));\n      }\n    }\n    $source_phids = mpull($objects, 'getPHID');\n\n    if (!$edge_types) {\n      throw new Exception(\n        pht(\n          'Edge search must specify a nonempty list of edge types.'));\n    }\n\n    $edge_map = $this->getConduitEdgeTypeMap();\n\n    $constant_map = array();\n    $edge_constants = array();\n    foreach ($edge_types as $edge_type) {\n      if (!isset($edge_map[$edge_type])) {\n        throw new Exception(\n          pht(\n            'Edge type \"%s\" is not a recognized edge type.',\n            $edge_type));\n      }\n\n      $constant = $edge_map[$edge_type]->getEdgeConstant();\n\n      $edge_constants[] = $constant;\n      $constant_map[$constant] = $edge_type;\n    }\n\n    $edge_query = id(new PhabricatorEdgeObjectQuery())\n      ->setViewer($viewer)\n      ->withSourcePHIDs($source_phids)\n      ->withEdgeTypes($edge_constants);\n\n    if ($destination_phids) {\n      $edge_query->withDestinationPHIDs($destination_phids);","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/edges/conduit/EdgeSearchConduitAPIMethod.php#L91-L127","documentation":"Thrown by `edge.search` when a `types` entry is not a recognized conduit edge-type key. Valid keys are the conduit keys registered by PhabricatorEdgeType subclasses (built via getConduitKey(), e.g. `task.project`, `task.subscriber`, `revision.reviewers`); arbitrary constants, numeric edge constants from older APIs, or invented names fail the map lookup. Each recognized key is then translated to its internal edge constant for the query.","triggerScenarios":"Passing legacy numeric edge constants (e.g. 1, 41) instead of string keys; guessing names like `'project'` or `'members'` instead of `'task.project'`/`'project.member'`; casing or pluralization mistakes (`'task.projects'`); copy-pasting constants from database `edge` table rows rather than from the conduit type map.","commonSituations":"Migrating old scripts that used `edge.edit`/manual constants to `edge.search`; developers reading the `worker`/edge database tables instead of the API surface; version drift where a key was renamed across Phabricator updates.","solutions":["List all valid keys by calling `edge.search` with no parameters (it returns the full key/name/inverse table) or `--help` on the CLI equivalent","Replace numeric constants with their conduit keys (e.g. 41 -> `task.project` style keys from the map)","Verify spelling exactly — keys are lowercase, dot-separated, and singular/plural sensitive"],"exampleFix":"// before\n$client->callMethod('edge.search', array(\n  'sourcePHIDs' => array($task_phid),\n  'types' => array(41),              // legacy numeric constant\n));\n\n// after\n$client->callMethod('edge.search', array(\n  'sourcePHIDs' => array($task_phid),\n  'types' => array('task.project'), // conduit key from the type map\n));","handlingStrategy":"validation","validationCode":"// Load the recognized keys once, then assert before every call\n$meta = $client->callMethod('edge.search', array());\n$valid_keys = array();\nforeach ($meta['data'] as $row) { $valid_keys[$row['type']] = true; }\nforeach ($types as $t) {\n  if (!isset($valid_keys[$t])) {\n    throw new InvalidArgumentException('Unknown edge type: '.$t);\n  }\n}","typeGuard":"function isConduitEdgeType($type, array $validKeys) {\n  return is_string($type) && isset($validKeys[$type]);\n}","tryCatchPattern":"try {\n  $result = $client->callMethod('edge.search', $params);\n} catch (ConduitClientException $ex) {\n  if (strpos($ex->getMessage(), 'not a recognized edge type') !== false) {\n    // refresh the key map, correct the type list, retry\n  }\n  throw $ex;\n}","preventionTips":["Never use numeric edge constants from the database with edge.search; use conduit keys","Pin the edge type keys your integration uses and validate them against the live map after Phabricator upgrades"],"tags":["phabricator","conduit","api","edges","invalid-enum","edge-type"],"backgroundTag":"invalid-enum-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}