phacility/phabricator · error · Exception
No such object "%s"!
Error message
No such object "%s"!
What it means
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.
Source
Thrown at src/applications/tokens/editor/PhabricatorTokenGivenEditor.php:166
->setViewer($this->requireActor())
->withPHIDs(array($token_phid))
->executeOne();
if (!$token) {
throw new Exception(pht('No such token "%s"!', $token_phid));
}
return $token;
}
private function validateObject($object_phid) {
$object = id(new PhabricatorObjectQuery())
->setViewer($this->requireActor())
->withPHIDs(array($object_phid))
->executeOne();
if (!$object) {
throw new Exception(pht('No such object "%s"!', $object_phid));
}
return $object;
}
private function loadCurrentToken(PhabricatorTokenReceiverInterface $object) {
return id(new PhabricatorTokenGiven())->loadOneWhere(
'authorPHID = %s AND objectPHID = %s',
$this->requireActor()->getPHID(),
$object->getPHID());
}
private function publishTransaction(
PhabricatorTokenReceiverInterface $object,
$old_token_phid,
$new_token_phid) {
View on GitHub (pinned to 5720a38cfe)
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
Example fix
// before: awarding with a stale object PHID
$editor->giveTokenTo('PHID-TASK-gone', $token_phid);
// after: verify the target resolves first
$object = id(new PhabricatorObjectQuery())
->setViewer($actor)
->withPHIDs(array($object_phid))
->executeOne();
if ($object) {
$editor->giveTokenTo($object->getPHID(), $token_phid);
} Defensive patterns
Strategy: validation
Validate before calling
$object = id(new PhabricatorObjectQuery())
->setViewer($actor)
->withPHIDs(array($object_phid))
->executeOne();
if (!$object) {
// stale or invisible target; refresh the reference instead of giving a token
} Try / catch
Catch Exception from the editor, verify the target PHID with PhabricatorObjectQuery as the acting viewer, and only retry when the object resolves.
Prevention
- Resolve target PHIDs as the acting user before awarding tokens
- Purge cached object references when objects may have been deleted or policy-hidden
When it happens
Trigger: Giving a token to a PHID that is deleted, malformed, or hidden from the acting user by view policies.
Common situations: Pages or clients holding references to deleted objects; automated reaction clients posting old PHIDs; policy changes that revoked visibility of the target.
Related errors
- No such token "%s"!
- No public key exists with ID "%s".
- Service "%s" does not exist or could not be loaded!
- Unable to load Calendar import with ID "%s".
- ERR_NOT_FOUND
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/fccd99dd523c4ee7.
Report an issue: GitHub.