phacility/phabricator · error · PhutilAggregateException

Unable to allocate any binding as a resource.

Error message

Unable to allocate any binding as a resource.

What it means

The Almanac host blueprint allocates a Drydock resource by iterating candidate Almanac service bindings; each allocation attempt (resource->allocateResource(), guarded by a per-binding slot lock) is wrapped in try/catch and collected into $exceptions. If every binding fails, PhutilAggregateException is thrown wrapping each per-binding cause. The real diagnosis lives in the aggregated exceptions, not this top-level message.

Source

Thrown at src/applications/drydock/blueprint/DrydockAlmanacServiceHostBlueprintImplementation.php:100

      $device_name = $device->getName();

      $binding_phid = $binding->getPHID();

      $resource = $this->newResourceTemplate($blueprint)
        ->setActivateWhenAllocated(true)
        ->setAttribute('almanacDeviceName', $device_name)
        ->setAttribute('almanacServicePHID', $binding->getServicePHID())
        ->setAttribute('almanacBindingPHID', $binding_phid)
        ->needSlotLock("almanac.host.binding({$binding_phid})");

      try {
        return $resource->allocateResource();
      } catch (Exception $ex) {
        $exceptions[] = $ex;
      }
    }

    throw new PhutilAggregateException(
      pht('Unable to allocate any binding as a resource.'),
      $exceptions);
  }

  public function destroyResource(
    DrydockBlueprint $blueprint,
    DrydockResource $resource) {
    // We don't create anything when allocating hosts, so we don't need to do
    // any cleanup here.
    return;
  }

  public function getResourceName(
    DrydockBlueprint $blueprint,
    DrydockResource $resource) {
    $device_name = $resource->getAttribute(
      'almanacDeviceName',
      pht('<Unknown>'));

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Catch PhutilAggregateException and iterate getExceptions() to see each binding's actual failure
  2. Check Drydock resource/lease logs (`bin/drydock log`, Drydock console) for the underlying causes
  3. Add or repair Almanac bindings/devices so at least one healthy host is available
  4. Verify the blueprint's SSH credential and that devices are reachable and in service
Defensive patterns

Strategy: try-catch

Try / catch

try {
  $resource = $blueprint->allocateResource($lease);
} catch (PhutilAggregateException $ex) {
  foreach ($ex->getExceptions() as $cause) {
    // The real blockers are the per-binding failures.
    phlog($cause);
  }
  throw $ex;
}

Prevention

When it happens

Trigger: Every active binding for the blueprint's Almanac services fails allocateResource(): exhausted host capacity/slot locks, Almanac device or service misconfiguration, denied SSH credentials, or reservation conflicts. A single failing binding is tolerated; only total failure throws.

Common situations: All devices behind the Almanac service are offline or at capacity; the blueprint's credential (Passphrase SSH private key) is invalid so every host setup fails; wrong service type filtering out all bindings; small clusters where one device down means zero candidates.

Related errors


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