phacility/phabricator · warning · Exception
Edge search must specify a nonempty list of edge types.
Error message
Edge search must specify a nonempty list of edge types.
What it means
Thrown by `edge.search` when the `types` parameter is missing, empty, or not a list of strings. Edge types constrain which relationships the query traverses (e.g. `task.project`, `revision.reviewers`); there is no 'all edges' mode over Conduit because the edge table mixes dozens of relation types, so a nonempty list is mandatory before the type map lookup.
Source
Thrown at src/infrastructure/edges/conduit/EdgeSearchConduitAPIMethod.php:98
$object_query = id(new PhabricatorObjectQuery())
->setViewer($viewer)
->withNames($source_phids);
$object_query->execute();
$objects = $object_query->getNamedResults();
foreach ($source_phids as $phid) {
if (empty($objects[$phid])) {
throw new Exception(
pht(
'Source PHID "%s" does not identify a valid object, or you do '.
'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();
View on GitHub (pinned to 5720a38cfe)
Solutions
- Supply at least one recognized edge type key: `'types' => array('task.project')`
- Discover valid keys by calling `edge.search` with no arguments — the method returns the table of conduit keys, names, and inverses
Example fix
// before
$client->callMethod('edge.search', array(
'sourcePHIDs' => array('PHID-PROJ-xyz'),
));
// after
$client->callMethod('edge.search', array(
'sourcePHIDs' => array('PHID-PROJ-xyz'),
'types' => array('task.project'),
)); Defensive patterns
Strategy: validation
Validate before calling
if (empty($params['types']) || !is_array($params['types'])) {
throw new InvalidArgumentException(
'edge.search requires a nonempty types list, e.g. array("task.project")');
}
$result = $client->callMethod('edge.search', $params); Prevention
- Make the types list a required key in your conduit call builders
- Fetch the valid key table once (edge.search with no args) and assert your configured keys against it at startup
When it happens
Trigger: `edge.search` with only `sourcePHIDs` and no `types`; `'types' => array()`; passing `null` or a scalar where the list is expected; Python/JS clients omitting the key entirely because it looks optional.
Common situations: Copy-paste Conduit call templates where the types line was dropped; dynamically built parameter dicts whose types array conditionally ends up empty; misunderstanding that destinationPHIDs alone does not imply the edge type.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Source PHID "%s" does not identify a valid object, or you do
- Edge type "%s" is not a recognized edge type.
- API Method "%s" defines a disallowed parameter, "%s". This p
- API Method "%s" does not define these parameters: %s.
- Conduit API method "%s" does not exist.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/8b1416d79f458d88.
Report an issue: GitHub.