phacility/phabricator · warning · Exception
Edge type " " is not a recognized edge type.
Error message
Edge type "%s" is not a recognized edge type.
What it means
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.
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
Example fix
// before
$client->callMethod('edge.search', array(
'sourcePHIDs' => array($task_phid),
'types' => array(41), // legacy numeric constant
));
// after
$client->callMethod('edge.search', array(
'sourcePHIDs' => array($task_phid),
'types' => array('task.project'), // conduit key from the type map
)); Defensive patterns
Strategy: validation
Validate before calling
// Load the recognized keys once, then assert before every call
$meta = $client->callMethod('edge.search', array());
$valid_keys = array();
foreach ($meta['data'] as $row) { $valid_keys[$row['type']] = true; }
foreach ($types as $t) {
if (!isset($valid_keys[$t])) {
throw new InvalidArgumentException('Unknown edge type: '.$t);
}
} Type guard
function isConduitEdgeType($type, array $validKeys) {
return is_string($type) && isset($validKeys[$type]);
} Try / catch
try {
$result = $client->callMethod('edge.search', $params);
} catch (ConduitClientException $ex) {
if (strpos($ex->getMessage(), 'not a recognized edge type') !== false) {
// refresh the key map, correct the type list, retry
}
throw $ex;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Edge search must specify a nonempty list of edge types.
- Source PHID " " does not identify a valid object, or you do…
- API Method " " defines a disallowed parameter, " ". This…
- API Method " " does not define these parameters: .
- Calls to "transaction.search" must not specify both an…
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/5f921543b775591b.
Report an issue: GitHub.
Appendix: source
Thrown at src/infrastructure/edges/conduit/EdgeSearchConduitAPIMethod.php:109
'not have permission to view it.',
$phid));
}
}
$source_phids = mpull($objects, 'getPHID');
if (!$edge_types) {
throw new Exception(
pht(
'Edge search must specify a nonempty list of edge types.'));
}
$edge_map = $this->getConduitEdgeTypeMap();
$constant_map = array();
$edge_constants = array();
foreach ($edge_types as $edge_type) {
if (!isset($edge_map[$edge_type])) {
throw new Exception(
pht(
'Edge type "%s" is not a recognized edge type.',
$edge_type));
}
$constant = $edge_map[$edge_type]->getEdgeConstant();
$edge_constants[] = $constant;
$constant_map[$constant] = $edge_type;
}
$edge_query = id(new PhabricatorEdgeObjectQuery())
->setViewer($viewer)
->withSourcePHIDs($source_phids)
->withEdgeTypes($edge_constants);
if ($destination_phids) {
$edge_query->withDestinationPHIDs($destination_phids);View on GitHub (pinned to 5720a38cfe)