phacility/phabricator · warning · PhutilArgumentUsageException
No source exists with ID "%s".
Error message
No source exists with ID "%s".
What it means
loadSource() resolves the selector as ID, PHID, or name and runs a NuanceSourceQuery with policy exceptions raised; when the result set is exactly empty, the failure message is chosen by selector type. This variant fires when the input was all digits (ctype_digit($source) true), so the code queried by numeric ID and found no NuanceSource with that row id — a usage exception, not a policy error (policies would have thrown differently).
Source
Thrown at src/applications/nuance/management/NuanceManagementWorkflow.php:53
switch ($kind) {
case 'id':
$message = pht(
'No source exists with ID "%s".',
$source);
break;
case 'phid':
$message = pht(
'No source exists with PHID "%s".',
$source);
break;
default:
$message = pht(
'No source exists with a name matching "%s".',
$source);
break;
}
throw new PhutilArgumentUsageException($message);
} else if (count($sources) > 1) {
$message = pht(
'More than one source matches "%s". Choose a narrower query, or '.
'use an ID or PHID to select a source. Matching sources: %s.',
$source,
implode(', ', mpull($sources, 'getName')));
throw new PhutilArgumentUsageException($message);
}
return head($sources);
}
protected function loadITem(PhutilArgumentParser $argv, $key) {
$item = $argv->getArg($key);
if (!strlen($item)) {
throw new PhutilArgumentUsageException(
pht(View on GitHub (pinned to 5720a38cfe)
Solutions
- List existing sources (Nuance application UI or a list query) and rerun with an existing id.
- Prefer PHID selectors in scripts — they are stable and unambiguous across environments that share data.
- If the source should exist, check you are on the right host/database and the viewer (usually an admin/omnipotent CLI viewer) can see it.
- Verify the value is the source ID, not the item/request id — a common mix-up.
Example fix
# before: # bin/nuance import --source 999 # no NuanceSource with id 999 # -> err: 'No source exists with ID "999".' # after: # bin/nuance import --source 12 # an existing source id
Defensive patterns
Strategy: validation
Validate before calling
// Verify the id resolves before running the command:
if (ctype_digit($source_selector)) {
$exists = id(new NuanceSourceQuery())
->setViewer($viewer)
->withIDs(array((int)$source_selector))
->execute();
if (!$exists) {
// stale/wrong id: look the source up afresh instead of invoking the CLI
}
} Prevention
- Pin scripts to PHIDs rather than numeric IDs; IDs shift across environments.
- Validate the selector against a live query (or list output) before batch runs.
- Distinguish source IDs from item/request IDs when copying values.
When it happens
Trigger: Running a nuance management command with --source <digits> where no nuance_source row has that id: e.g. --source 999 after the source was deleted, an id copied from another environment, or a leading-zero id string that matches nothing.
Common situations: Environment drift (scripting a staging ID against production); deleted or never-created sources; copy-paste of an issue number instead of the source id; output from an older 'list' run.
Related errors
- No source exists with PHID "%s".
- No source exists with a name matching "%s".
- Build plan "%s" does not exist.
- This source ("%s") does not expose import cursors.
- This source ("%s") does not have any import cursors.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/cb694f8d9d7715f5.
Report an issue: GitHub.