{"record":{"id":"57f99a31479e1d31","repo":"phacility/phabricator","slug":"no-such-resource-s","errorCode":null,"errorMessage":"No such resource \"%s\"!","messagePattern":"No such resource \"(.+?)\"!","errorType":"exception","errorClass":"PhabricatorWorkerPermanentFailureException","httpStatus":null,"severity":"error","filePath":"src/applications/drydock/worker/DrydockWorker.php","lineNumber":32,"sourceCode":"      ->withPHIDs(array($lease_phid))\n      ->executeOne();\n    if (!$lease) {\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht('No such lease \"%s\"!', $lease_phid));\n    }\n\n    return $lease;\n  }\n\n  protected function loadResource($resource_phid) {\n    $viewer = $this->getViewer();\n\n    $resource = id(new DrydockResourceQuery())\n      ->setViewer($viewer)\n      ->withPHIDs(array($resource_phid))\n      ->executeOne();\n    if (!$resource) {\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht('No such resource \"%s\"!', $resource_phid));\n    }\n\n    return $resource;\n  }\n\n  protected function loadOperation($operation_phid) {\n    $viewer = $this->getViewer();\n\n    $operation = id(new DrydockRepositoryOperationQuery())\n      ->setViewer($viewer)\n      ->withPHIDs(array($operation_phid))\n      ->executeOne();\n    if (!$operation) {\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht('No such operation \"%s\"!', $operation_phid));\n    }\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/drydock/worker/DrydockWorker.php#L14-L50","documentation":"DrydockWorker::loadResource() loads a resource by PHID with the omnipotent user; if no DrydockResource row matches, it throws PhabricatorWorkerPermanentFailureException so the task fails permanently rather than retrying. The placeholder is the resource PHID from the task data.","triggerScenarios":"A drydock worker task calls loadResource($phid) for a resource that no longer exists: it was broken, released, destroyed, or garbage-collected after the task was queued, or the PHID in the task data is wrong.","commonSituations":"Resource destroyed while dependent tasks (lease updates, operations) are still in the queue; resources pruned by the garbage collector; stale tasks after restoring a database from backup; task data built with a resource PHID from another install.","solutions":["Verify the resource exists via the Drydock resource UI or a DrydockResourceQuery by PHID.","If the resource was destroyed/released, archive the failed task — permanent failure is expected for orphans.","Inspect Drydock logs around the resource to see what destroyed it and whether dependent tasks should have been cancelled first.","Audit the task-scheduling code if the PHID was never valid."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$resource = id(new DrydockResourceQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withPHIDs(array($resource_phid))\n  ->executeOne();\nif (!$resource) {\n  return; // skip or reschedule; do not queue tasks for missing resources\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check resource existence before scheduling dependent worker tasks.","Cancel queued tasks when destroying or releasing resources.","Audit scheduled task payloads if unknown PHIDs appear — they usually indicate cross-environment data or restore-from-backup staleness."],"tags":["drydock","worker","resource","phid-not-found","php"],"backgroundTag":"phid-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}