{"record":{"id":"eec224767faadc4f","repo":"phacility/phabricator","slug":"lease-s-never-activated-eec224","errorCode":null,"errorMessage":"Lease \"%s\" never activated.","messagePattern":"Lease \"(.+?)\" never activated\\.","errorType":"exception","errorClass":"PhabricatorWorkerPermanentFailureException","httpStatus":null,"severity":"error","filePath":"src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php","lineNumber":91,"sourceCode":"        array(\n          'drydockLeasePHID' => $lease->getPHID(),\n        ));\n\n      $lease->queueForActivation();\n\n      $build_target\n        ->setDetail('exec.leasePHID', $lease->getPHID())\n        ->save();\n    }\n\n    if ($lease->isActivating()) {\n      // TODO: Smart backoff?\n      throw new PhabricatorWorkerYieldException(15);\n    }\n\n    if (!$lease->isActive()) {\n      // TODO: We could just forget about this lease and retry?\n      throw new PhabricatorWorkerPermanentFailureException(\n        pht(\n          'Lease \"%s\" never activated.',\n          $lease->getPHID()));\n    }\n  }\n\n  public function getArtifactOutputs() {\n    return array(\n      array(\n        'name' => pht('Working Copy'),\n        'key' => $this->getSetting('name'),\n        'type' => HarbormasterWorkingCopyArtifact::ARTIFACTCONST,\n      ),\n    );\n  }\n\n  public function getFieldSpecifications() {\n    return array(","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php#L73-L109","documentation":"After acquiring or reloading the working-copy lease, the step first yields 15 seconds while the lease is activating; if on a later pass the lease is neither activating nor active (e.g. it ended up broken, released, or expired), it throws PhabricatorWorkerPermanentFailureException with 'Lease \"%s\" never activated.' The lease state machine stalled somewhere other than STATUS_ACTIVE.","triggerScenarios":"The Drydock blueprint failed to allocate/activate the lease (no enabled working-copy blueprint, allocation error, host at capacity) so the lease moved to broken; or the lease was activated but expired/released between the yield and the next check.","commonSituations":"No Drydock Working Copy blueprint exists or all are disabled; blueprint SSH/host credentials misconfigured so activation fails; all working-copy resources are full; long queue delays so leases expire before the target re-checks.","solutions":["Inspect the failed lease in the Drydock UI (lease status and log) to see where activation stopped.","Ensure at least one Drydock Working Copy blueprint is configured and enabled and that its resources can actually be allocated.","Fix the underlying blueprint/host errors shown in the Drydock logs, then restart the build.","If leases expire during activation, increase the lease expiration window in the blueprint."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before starting builds, confirm a working-copy blueprint is available:\n$blueprints = id(new DrydockBlueprintQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withTypes(array('working-copy'))\n  ->execute();\nif (!$blueprints) {\n  // no blueprint can ever activate a lease - configure one first\n}","typeGuard":null,"tryCatchPattern":"try {\n  // execute lease step\n} catch (PhabricatorWorkerPermanentFailureException $ex) {\n  if (preg_match('/never activated/', $ex->getMessage())) {\n    // inspect the Drydock lease log, fix the blueprint, then restart the build\n  }\n}","preventionTips":["Always have at least one enabled working-copy blueprint with healthy resources.","Watch Drydock lease logs for repeated activation failures before they become build failures.","Size resource capacity so leases are not stuck in queue past activation."],"tags":["harbormaster","drydock","lease","phabricator"],"backgroundTag":"resource-activation-timeout","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}