{"record":{"id":"579a9ce6fc023297","repo":"phacility/phabricator","slug":"no-such-object-s-exists-579a9c","errorCode":null,"errorMessage":"No such object \"%s\" exists!","messagePattern":"No such object \"(.+?)\" exists!","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php","lineNumber":42,"sourceCode":"  public function execute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n\n    $object_names = $args->getArg('objects');\n    if (!$object_names) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify one or more objects to destroy.'));\n    }\n\n    $object_query = id(new PhabricatorObjectQuery())\n      ->setViewer($this->getViewer())\n      ->withNames($object_names);\n\n    $object_query->execute();\n\n    $named_objects = $object_query->getNamedResults();\n    foreach ($object_names as $object_name) {\n      if (empty($named_objects[$object_name])) {\n        throw new PhutilArgumentUsageException(\n          pht('No such object \"%s\" exists!', $object_name));\n      }\n    }\n\n    foreach ($named_objects as $object_name => $object) {\n      if (!($object instanceof PhabricatorDestructibleInterface)) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Object \"%s\" can not be destroyed (it does not implement %s).',\n            $object_name,\n            'PhabricatorDestructibleInterface'));\n      }\n    }\n\n    $banner = <<<EOBANNER\n                                  uuuuuuu\n                               uu###########uu\n                            uu#################uu","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php#L24-L60","documentation":"After resolving the supplied names through PhabricatorObjectQuery, any name with no entry in getNamedResults() triggers this usage exception. The name either does not exist, is malformed, or resolves to nothing visible to the administrative viewer.","triggerScenarios":"Passing a monogram or PHID that fails to resolve: a typo'd monogram, a wrong PHID type prefix, an already-destroyed object, or an object hidden from the acting user by policy.","commonSituations":"Copy-pasted PHIDs truncated in transit; objects destroyed by a previous run; CLI executed as a user who cannot see the target object.","solutions":["Verify the object exists and is visible to the acting user (open its monogram URI in the web UI as that user)","Correct the monogram/PHID spelling and rerun","Run the command as an administrator (for example with --as) who can see the object"],"exampleFix":"# before\n./bin/remove destroy T999999x\n\n# after: confirm the object resolves in the UI, then destroy\n# (open /T123 as the same user first)\n./bin/remove destroy T123","handlingStrategy":"validation","validationCode":"// Resolve names exactly like the workflow does, before destroying.\n$query = id(new PhabricatorObjectQuery())\n  ->setViewer($viewer)\n  ->withNames($names);\n$query->execute();\n$missing = array_diff($names, array_keys($query->getNamedResults()));\nif ($missing) {\n  // report and stop; do not proceed to destroy\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-resolve names with PhabricatorObjectQuery as the same viewer before invoking destroy","Run destructive commands as an administrator who can see all target objects","Validate copy-pasted PHIDs for full length and correct type prefix"],"tags":["cli","usage","destroy","not-found"],"backgroundTag":"object-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}