{"record":{"id":"05c3457526c02bf3","repo":"phacility/phabricator","slug":"no-such-operation-s","errorCode":null,"errorMessage":"No such operation \"%s\"!","messagePattern":"No such operation \"(.+?)\"!","errorType":"exception","errorClass":"PhabricatorWorkerPermanentFailureException","httpStatus":null,"severity":"error","filePath":"src/applications/drydock/worker/DrydockWorker.php","lineNumber":47,"sourceCode":"      ->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\n    return $operation;\n  }\n\n  protected function loadCommands($target_phid) {\n    $viewer = $this->getViewer();\n\n    $commands = id(new DrydockCommandQuery())\n      ->setViewer($viewer)\n      ->withTargetPHIDs(array($target_phid))\n      ->withConsumed(false)\n      ->execute();\n\n    $commands = msort($commands, 'getID');\n\n    return $commands;","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/drydock/worker/DrydockWorker.php#L29-L65","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check whether the operation still exists (Drydock UI, repository operations list) using the PHID from the error.","If the operation was cancelled or deleted, archive the permanently failed task — it is an orphan and correct to fail.","If operations routinely vanish under queued tasks, review cancellation handling to ensure tasks are cancelled too.","If the PHID is malformed, trace where the worker task arguments were constructed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$operation = id(new DrydockRepositoryOperationQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withPHIDs(array($operation_phid))\n  ->executeOne();\nif (!$operation) {\n  return; // operation cancelled/destroyed; nothing to do\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the operation still exists before queueing follow-up work.","On operation cancellation, also cancel queued operation worker tasks.","Treat permanent failure of orphaned operation tasks as normal cleanup."],"tags":["drydock","worker","operation","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"}