phacility/phabricator · error · PhabricatorWorkerPermanentFailureException

Lease "%s" never activated.

Error message

Lease "%s" never activated.

What it means

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.

Source

Thrown at src/applications/drydock/worker/DrydockRepositoryOperationUpdateWorker.php:147

        ->setWorkingCopyLeasePHID($lease->getPHID())
        ->save();

      $lease->queueForActivation();
    }

    if ($lease->isActivating()) {
      throw new PhabricatorWorkerYieldException(15);
    }

    if (!$lease->isActive()) {
      $vcs_error = $working_copy->getCommandError($lease);
      if ($vcs_error) {
        $operation
          ->setCommandError($vcs_error)
          ->save();
      }

      throw new PhabricatorWorkerPermanentFailureException(
        pht(
          'Lease "%s" never activated.',
          $lease->getPHID()));
    }

    return $lease;
  }

  private function buildRepositoryMap(DrydockRepositoryOperation $operation) {
    $repository = $operation->getRepository();

    $target = $operation->getRepositoryTarget();
    list($type, $name) = explode(':', $target, 2);
    switch ($type) {
      case 'branch':
        $spec = array(
          'branch' => $name,
        );

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Check getCommandError() on the operation: the worker saves the VCS command error for exactly this case.
  2. Open the lease and resource logs in Drydock to find which VCS command failed and why.
  3. Fix the root cause (credentials, ref existence, network/disk) and submit the operation again.
  4. If failures are transient, re-run the operation; it will allocate a new lease.
Defensive patterns

Strategy: retry

Try / catch

try {
  $this->loadLease($operation);
} catch (PhabricatorWorkerPermanentFailureException $ex) {
  $error = $operation->getCommandError(); // VCS failure captured by the worker
  // surface $error to the user; re-submitting the operation leases anew
}

Prevention

When it happens

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

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

Related errors


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