{"record":{"id":"b1495525a2a32956","repo":"phacility/phabricator","slug":"lease-s-never-activated","errorCode":null,"errorMessage":"Lease \"%s\" never activated.","messagePattern":"Lease \"(.+?)\" never activated\\.","errorType":"exception","errorClass":"PhabricatorWorkerPermanentFailureException","httpStatus":null,"severity":"error","filePath":"src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php","lineNumber":147,"sourceCode":"        ->setWorkingCopyLeasePHID($lease->getPHID())\n        ->save();\n\n      $lease->queueForActivation();\n    }\n\n    if ($lease->isActivating()) {\n      throw new PhabricatorWorkerYieldException(15);\n    }\n\n    if (!$lease->isActive()) {\n      $vcs_error = $working_copy->getCommandError($lease);\n      if ($vcs_error) {\n        $operation\n          ->setCommandError($vcs_error)\n          ->save();\n      }\n\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht(\n          'Lease \"%s\" never activated.',\n          $lease->getPHID()));\n    }\n\n    return $lease;\n  }\n\n  private function buildRepositoryMap(DrydockRepositoryOperation $operation) {\n    $repository = $operation->getRepository();\n\n    $target = $operation->getRepositoryTarget();\n    list($type, $name) = explode(':', $target, 2);\n    switch ($type) {\n      case 'branch':\n        $spec = array(\n          'branch' => $name,\n        );","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php#L129-L165","documentation":"While an operation waits for its working-copy lease, the worker yields if the lease is still activating. Once activating finishes and the lease is still not active, it captures the VCS command error (if any) onto the operation and fails permanently: the lease ended up broken or released instead of active. The lease lifecycle is over, so the operation cannot proceed.","triggerScenarios":"The working-copy lease broke during activation (clone/checkout command failed), so isActive() is false after activation completes; the lease was released externally while the operation waited.","commonSituations":"Git/Hg clone failures during working-copy provisioning (bad ref, network, auth); disk full on the host serving working copies; resource broken under the lease while the operation queued.","solutions":["Check getCommandError() on the operation: the worker saves the VCS command error for exactly this case.","Open the lease and resource logs in Drydock to find which VCS command failed and why.","Fix the root cause (credentials, ref existence, network/disk) and submit the operation again.","If failures are transient, re-run the operation; it will allocate a new lease."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  $this->loadLease($operation);\n} catch (PhabricatorWorkerPermanentFailureException $ex) {\n  $error = $operation->getCommandError(); // VCS failure captured by the worker\n  // surface $error to the user; re-submitting the operation leases anew\n}","preventionTips":["Keep working-copy provisioning healthy: verify refs, credentials, and disk before running operations.","Read getCommandError() on the operation; the worker saves the VCS error precisely for this failure."],"tags":["drydock","php","repository-operations","lease","activation","vcs","permanent-failure"],"backgroundTag":"lease-activation-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}