phacility/phabricator · error · PhabricatorWorkerPermanentFailureException

Lease "%s" never activated.

Error message

Lease "%s" never activated.

What it means

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.

Source

Thrown at src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php:91

        array(
          'drydockLeasePHID' => $lease->getPHID(),
        ));

      $lease->queueForActivation();

      $build_target
        ->setDetail('exec.leasePHID', $lease->getPHID())
        ->save();
    }

    if ($lease->isActivating()) {
      // TODO: Smart backoff?
      throw new PhabricatorWorkerYieldException(15);
    }

    if (!$lease->isActive()) {
      // TODO: We could just forget about this lease and retry?
      throw new PhabricatorWorkerPermanentFailureException(
        pht(
          'Lease "%s" never activated.',
          $lease->getPHID()));
    }
  }

  public function getArtifactOutputs() {
    return array(
      array(
        'name' => pht('Working Copy'),
        'key' => $this->getSetting('name'),
        'type' => HarbormasterWorkingCopyArtifact::ARTIFACTCONST,
      ),
    );
  }

  public function getFieldSpecifications() {
    return array(

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Inspect the failed lease in the Drydock UI (lease status and log) to see where activation stopped.
  2. Ensure at least one Drydock Working Copy blueprint is configured and enabled and that its resources can actually be allocated.
  3. Fix the underlying blueprint/host errors shown in the Drydock logs, then restart the build.
  4. If leases expire during activation, increase the lease expiration window in the blueprint.
Defensive patterns

Strategy: retry

Validate before calling

// Before starting builds, confirm a working-copy blueprint is available:
$blueprints = id(new DrydockBlueprintQuery())
  ->setViewer(PhabricatorUser::getOmnipotentUser())
  ->withTypes(array('working-copy'))
  ->execute();
if (!$blueprints) {
  // no blueprint can ever activate a lease - configure one first
}

Try / catch

try {
  // execute lease step
} catch (PhabricatorWorkerPermanentFailureException $ex) {
  if (preg_match('/never activated/', $ex->getMessage())) {
    // inspect the Drydock lease log, fix the blueprint, then restart the build
  }
}

Prevention

When it happens

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

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

Related errors


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