phacility/phabricator · error · PhabricatorWorkerPermanentFailureException

No such operation "%s"!

Error message

No such operation "%s"!

What it means

DrydockWorker::loadOperation() loads a DrydockRepositoryOperation by PHID with the omnipotent user; when the query returns nothing it throws PhabricatorWorkerPermanentFailureException, permanently failing the task. The placeholder is the operation PHID.

Source

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

      ->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));
    }

    return $operation;
  }

  protected function loadCommands($target_phid) {
    $viewer = $this->getViewer();

    $commands = id(new DrydockCommandQuery())
      ->setViewer($viewer)
      ->withTargetPHIDs(array($target_phid))
      ->withConsumed(false)
      ->execute();

    $commands = msort($commands, 'getID');

    return $commands;

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Check whether the operation still exists (Drydock UI, repository operations list) using the PHID from the error.
  2. If the operation was cancelled or deleted, archive the permanently failed task — it is an orphan and correct to fail.
  3. If operations routinely vanish under queued tasks, review cancellation handling to ensure tasks are cancelled too.
  4. If the PHID is malformed, trace where the worker task arguments were constructed.
Defensive patterns

Strategy: validation

Validate before calling

$operation = id(new DrydockRepositoryOperationQuery())
  ->setViewer(PhabricatorUser::getOmnipotentUser())
  ->withPHIDs(array($operation_phid))
  ->executeOne();
if (!$operation) {
  return; // operation cancelled/destroyed; nothing to do
}

Prevention

When it happens

Trigger: A drydock operation worker task calls loadOperation($phid) with an operation PHID that has no database row — the operation was cancelled/deleted after queueing, or the PHID in the task data is invalid.

Common situations: User cancels a repository operation while its worker task is still queued; operations pruned by daemons or garbage collection; stale task data after environment migrations; bugs building the task payload.

Related errors


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