{"record":{"id":"cb694f8d9d7715f5","repo":"phacility/phabricator","slug":"no-source-exists-with-id-s","errorCode":null,"errorMessage":"No source exists with ID \"%s\".","messagePattern":"No source exists with ID \"(.+?)\"\\.","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":"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).","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before:\n# bin/nuance import --source 999   # no NuanceSource with id 999\n# -> err: 'No source exists with ID \"999\".'\n\n# after:\n# bin/nuance import --source 12    # an existing source id","handlingStrategy":"validation","validationCode":"// Verify the id resolves before running the command:\nif (ctype_digit($source_selector)) {\n  $exists = id(new NuanceSourceQuery())\n    ->setViewer($viewer)\n    ->withIDs(array((int)$source_selector))\n    ->execute();\n  if (!$exists) {\n    // stale/wrong id: look the source up afresh instead of invoking the CLI\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["nuance","cli","entity-not-found","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"}