phacility/phabricator · error · PhabricatorWorkerPermanentFailureException

No such resource "%s"!

Error message

No such resource "%s"!

What it means

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.

Source

Thrown at src/applications/drydock/worker/DrydockWorker.php:32

      ->withPHIDs(array($lease_phid))
      ->executeOne();
    if (!$lease) {
      throw new PhabricatorWorkerPermanentFailureException(
        pht('No such lease "%s"!', $lease_phid));
    }

    return $lease;
  }

  protected function loadResource($resource_phid) {
    $viewer = $this->getViewer();

    $resource = id(new DrydockResourceQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($resource_phid))
      ->executeOne();
    if (!$resource) {
      throw new PhabricatorWorkerPermanentFailureException(
        pht('No such resource "%s"!', $resource_phid));
    }

    return $resource;
  }

  protected function loadOperation($operation_phid) {
    $viewer = $this->getViewer();

    $operation = id(new DrydockRepositoryOperationQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($operation_phid))
      ->executeOne();
    if (!$operation) {
      throw new PhabricatorWorkerPermanentFailureException(
        pht('No such operation "%s"!', $operation_phid));
    }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Verify the resource exists via the Drydock resource UI or a DrydockResourceQuery by PHID.
  2. If the resource was destroyed/released, archive the failed task — permanent failure is expected for orphans.
  3. Inspect Drydock logs around the resource to see what destroyed it and whether dependent tasks should have been cancelled first.
  4. Audit the task-scheduling code if the PHID was never valid.
Defensive patterns

Strategy: validation

Validate before calling

$resource = id(new DrydockResourceQuery())
  ->setViewer(PhabricatorUser::getOmnipotentUser())
  ->withPHIDs(array($resource_phid))
  ->executeOne();
if (!$resource) {
  return; // skip or reschedule; do not queue tasks for missing resources
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/57f99a31479e1d31. Report an issue: GitHub.