phacility/phabricator · warning · PhutilArgumentUsageException
No source exists with a name matching "%s".
Error message
No source exists with a name matching "%s".
What it means
The fallback case of loadSource()'s empty-result switch: the selector was neither all digits nor a PHID, so it was treated as a human-readable source NAME (name-matching query), and no Nuance source name matched. Note this fires only when zero sources matched — a name matching multiple sources takes the separate 'More than one source matches' branch instead.
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 source names (Nuance UI or list command) and rerun with an exact copy of the name.
- Prefer ID or PHID selectors in automation — names are user-editable and drift.
- Quote the argument and strip whitespace in scripts: --source "$(printf '%s' "$NAME" | tr -d '[:space:]')" if contamination is possible.
- If the source was renamed, update the script to the new name.
Example fix
# before: # bin/nuance import --source "supportdesk " # trailing space, no match # -> err: 'No source exists with a name matching "supportdesk ".' # after: # bin/nuance import --source "supportdesk"
Defensive patterns
Strategy: validation
Validate before calling
// For name selectors, match exactly what the query will match:
$trimmed = trim((string)$source_selector);
if ($trimmed !== $source_selector || $trimmed === '') {
// contaminated selector: normalize before invoking the CLI
}
$exists = id(new NuanceSourceQuery())
->setViewer($viewer)
->withNames(array($trimmed))
->execute();
if (count($exists) === 0) {
// no such name: fetch the current name list instead of guessing
} elseif (count($exists) > 1) {
// ambiguous: switch to an ID or PHID selector
} Prevention
- Prefer ID/PHID selectors in automation; names are editable and drift.
- Trim whitespace/newlines from name values built from files or variables.
- When renaming a source, update every script that addresses it by name.
When it happens
Trigger: Running a nuance command with --source <name> where the name query (NuanceSourceQuery with a name constraint) returns empty: typo in the name, wrong case/spelling, renamed source, or whitespace/newline contamination in the shell argument.
Common situations: Renaming sources in the UI and leaving scripts on the old name; freehand typing names instead of copying; trailing newline in $(cat file) style argument construction; names containing emoji/unicode mangled by terminal encoding.
Related errors
- No source exists with ID "%s".
- No source exists with PHID "%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/d0676259fd51a342.
Report an issue: GitHub.