phacility/phabricator · error · PhabricatorWorkerPermanentFailureException
Unable to load object ("%s") for webhook request ("%s").
Error message
Unable to load object ("%s") for webhook request ("%s"). What it means
The worker loads the object the webhook request is about using PhabricatorObjectQuery as the omnipotent user (so policies are not the issue). If the row is gone, the request is marked failed with ERRORTYPE_HOOK / ERROR_OBJECT and the task permanently fails -- the payload cannot be built for a deleted object.
Source
Thrown at src/applications/herald/worker/HeraldWebhookWorker.php:93
'fetch URI: %s',
$hook->getPHID(),
$request_phid,
$ex->getMessage()));
}
$object_phid = $request->getObjectPHID();
$object = id(new PhabricatorObjectQuery())
->setViewer($viewer)
->withPHIDs(array($object_phid))
->executeOne();
if (!$object) {
$this->failRequest(
$request,
HeraldWebhookRequest::ERRORTYPE_HOOK,
HeraldWebhookRequest::ERROR_OBJECT);
throw new PhabricatorWorkerPermanentFailureException(
pht(
'Unable to load object ("%s") for webhook request ("%s").',
$object_phid,
$request_phid));
}
$xaction_query = PhabricatorApplicationTransactionQuery::newQueryForObject(
$object);
$xaction_phids = $request->getTransactionPHIDs();
if ($xaction_phids) {
$xactions = $xaction_query
->setViewer($viewer)
->withObjectPHIDs(array($object_phid))
->withPHIDs($xaction_phids)
->execute();
$xactions = mpull($xactions, null, 'getPHID');
} else {
$xactions = array();View on GitHub (pinned to 5720a38cfe)
Solutions
- Accept the permanent failure -- the object no longer exists, so the payload cannot be sent.
- If these are noise, disable the hook or its rule for object types that get deleted frequently.
- Re-fire for a live object with './bin/herald call-webhook --id <hook> --object <object>'.
Defensive patterns
Strategy: try-catch
Validate before calling
// When queueing webhook requests, skip objects that no longer load:
$object = id(new PhabricatorObjectQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withPHIDs(array($object_phid))
->executeOne();
if (!$object) {
return; // object deleted; nothing to deliver
} Try / catch
try {
// queue/execute webhook work for an object
} catch (PhabricatorWorkerPermanentFailureException $ex) {
// object or request row disappeared; permanent, do not retry
phlog($ex->getMessage());
} Prevention
- Expect deletions to race queued webhook tasks; treat ERROR_OBJECT permanent failures as normal.
- Batch-delete objects only after draining or pausing related webhook queues if deliveries matter.
When it happens
Trigger: The object (task, revision, etc.) was deleted between the time the Herald rule queued the webhook request and the time the worker task executed; task data references an object removed by a partial DB restore.
Common situations: Object deletions racing a queued webhook backlog; environments where scripts mass-delete objects while hooks are active.
Related errors
- Unable to load specified webhook ("%s").
- Unable to load specified object ("%s").
- Unable to load webhook request ("%s"). It may have been garb
- Webhook request ("%s") is not in "%s" status (actual status
- Associated hook ("%s") for webhook request ("%s") is disable
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/cbe267f1e85bae3b.
Report an issue: GitHub.