{"record":{"id":"b86b6d4f8967fc4c","repo":"phacility/phabricator","slug":"no-source-exists-with-phid-s","errorCode":null,"errorMessage":"No source exists with PHID \"%s\".","messagePattern":"No source exists with PHID \"(.+?)\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/nuance/management/NuanceManagementWorkflow.php","lineNumber":53,"sourceCode":"      switch ($kind) {\n        case 'id':\n          $message = pht(\n            'No source exists with ID \"%s\".',\n            $source);\n          break;\n        case 'phid':\n          $message = pht(\n            'No source exists with PHID \"%s\".',\n            $source);\n          break;\n        default:\n          $message = pht(\n            'No source exists with a name matching \"%s\".',\n            $source);\n          break;\n      }\n\n      throw new PhutilArgumentUsageException($message);\n    } else if (count($sources) > 1) {\n      $message = pht(\n        'More than one source matches \"%s\". Choose a narrower query, or '.\n        'use an ID or PHID to select a source. Matching sources: %s.',\n        $source,\n        implode(', ', mpull($sources, 'getName')));\n\n      throw new PhutilArgumentUsageException($message);\n    }\n\n    return head($sources);\n  }\n\n  protected function loadITem(PhutilArgumentParser $argv, $key) {\n    $item = $argv->getArg($key);\n    if (!strlen($item)) {\n      throw new PhutilArgumentUsageException(\n        pht(","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/nuance/management/NuanceManagementWorkflow.php#L35-L71","documentation":"Same empty-result branch of loadSource() as 937, but the selector was recognized as a PHID (a PHID-NUAN-… string), so the query filtered by PHIDs and matched nothing. The selector-type switch (id / phid / name) picks this message, giving the operator a precise hint about what kind of lookup failed.","triggerScenarios":"Running a nuance command with --source PHID-NUAN-xxxx where no nuance_source row carries that PHID: deleted source, PHID copied from another install, transcription typo in the PHID, or a PHID prefix that is not a Nuance source (the code special-cases PHID_TYPE_UNKNOWN handling earlier for junk prefixes).","commonSituations":"Cross-install copy-paste; sources deleted during cleanup while old runbooks keep the PHID; scripts templated with a PHID literal; truncation of the long PHID string by terminals or ticket fields.","solutions":["Find the source's current PHID in the Nuance UI (or a list query) and rerun with the exact string.","If the source was deleted, recreate it or pick a live one — deleted PHIDs never resolve again.","Copy PHIDs whole; watch for line-wrapping/truncation when pasting into terminals or tickets.","Confirm the PHID type prefix is NUAN (a different prefix means you grabbed some other object's PHID)."],"exampleFix":"# before:\n# bin/nuance import --source PHID-NUAN-xyz9999   # stale/deleted PHID\n# -> err: 'No source exists with PHID \"PHID-NUAN-xyz9999\".'\n\n# after:\n# bin/nuance import --source PHID-NUAN-4b3q2c current live source PHID","handlingStrategy":"validation","validationCode":"if (preg_match('/^PHID-NUAN-/', $source_selector)) {\n  $exists = id(new NuanceSourceQuery())\n    ->setViewer($viewer)\n    ->withPHIDs(array($source_selector))\n    ->execute();\n  if (!$exists) {\n    // stale or foreign PHID: resolve the current PHID before running\n  }\n}","typeGuard":"// PHP: narrow a selector to a Nuance source PHID before use\nfunction is_nuance_source_phid(string $s): bool {\n  return (bool)preg_match('/^PHID-NUAN-[a-z0-9]{4,}$/i', $s);\n}","tryCatchPattern":null,"preventionTips":["Confirm the PHID prefix is PHID-NUAN (NUAN = Nuance source) before pasting.","Copy PHIDs in full; watch for terminal wrapping and truncation.","After deleting sources, sweep runbooks and scripts for their PHIDs."],"tags":["nuance","cli","entity-not-found","phid","usage-error"],"backgroundTag":"entity-not-found-by-id","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}