{"record":{"id":"fccd99dd523c4ee7","repo":"phacility/phabricator","slug":"no-such-object-s-fccd99","errorCode":null,"errorMessage":"No such object \"%s\"!","messagePattern":"No such object \"(.+?)\"!","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/tokens/editor/PhabricatorTokenGivenEditor.php","lineNumber":166,"sourceCode":"      ->setViewer($this->requireActor())\n      ->withPHIDs(array($token_phid))\n      ->executeOne();\n\n    if (!$token) {\n      throw new Exception(pht('No such token \"%s\"!', $token_phid));\n    }\n\n    return $token;\n  }\n\n  private function validateObject($object_phid) {\n    $object = id(new PhabricatorObjectQuery())\n      ->setViewer($this->requireActor())\n      ->withPHIDs(array($object_phid))\n      ->executeOne();\n\n    if (!$object) {\n      throw new Exception(pht('No such object \"%s\"!', $object_phid));\n    }\n\n    return $object;\n  }\n\n  private function loadCurrentToken(PhabricatorTokenReceiverInterface $object) {\n    return id(new PhabricatorTokenGiven())->loadOneWhere(\n      'authorPHID = %s AND objectPHID = %s',\n      $this->requireActor()->getPHID(),\n      $object->getPHID());\n  }\n\n\n  private function publishTransaction(\n    PhabricatorTokenReceiverInterface $object,\n    $old_token_phid,\n    $new_token_phid) {\n","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/tokens/editor/PhabricatorTokenGivenEditor.php#L148-L184","documentation":"validateObject() in the token editor verifies the target object PHID with a PhabricatorObjectQuery scoped to the acting user. A failed load means the PHID does not exist or is not visible to the actor, so a token cannot be given for it.","triggerScenarios":"Giving a token to a PHID that is deleted, malformed, or hidden from the acting user by view policies.","commonSituations":"Pages or clients holding references to deleted objects; automated reaction clients posting old PHIDs; policy changes that revoked visibility of the target.","solutions":["Verify the PHID resolves for the acting user before awarding the token","Refresh the object reference on the client and retry with the current PHID","Run as a viewer who can see the object if policies are the cause"],"exampleFix":"// before: awarding with a stale object PHID\n$editor->giveTokenTo('PHID-TASK-gone', $token_phid);\n\n// after: verify the target resolves first\n$object = id(new PhabricatorObjectQuery())\n  ->setViewer($actor)\n  ->withPHIDs(array($object_phid))\n  ->executeOne();\nif ($object) {\n  $editor->giveTokenTo($object->getPHID(), $token_phid);\n}","handlingStrategy":"validation","validationCode":"$object = id(new PhabricatorObjectQuery())\n  ->setViewer($actor)\n  ->withPHIDs(array($object_phid))\n  ->executeOne();\nif (!$object) {\n  // stale or invisible target; refresh the reference instead of giving a token\n}","typeGuard":null,"tryCatchPattern":"Catch Exception from the editor, verify the target PHID with PhabricatorObjectQuery as the acting viewer, and only retry when the object resolves.","preventionTips":["Resolve target PHIDs as the acting user before awarding tokens","Purge cached object references when objects may have been deleted or policy-hidden"],"tags":["tokens","editor","not-found","policies"],"backgroundTag":"object-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}