phacility/phabricator · error · PhutilArgumentUsageException

No known blueprint class can ever allocate the specified lea

Error message

No known blueprint class can ever allocate the specified lease. Check that the resource type is spelled correctly.

What it means

A PhutilArgumentUsageException from `bin/drydock lease` raised before any lease is acquired: DrydockBlueprintImplementation::getAllForAllocatingLease($lease) returned an empty set, meaning no registered blueprint implementation class in the entire install declares that it could ever allocate the requested resource type (with the given attributes). The most common cause is a misspelled --type value; it is a static capability check, independent of whether blueprint instances are configured or enabled.

Source

Thrown at src/applications/drydock/management/DrydockManagementLeaseWorkflow.php:321

      }

      $seen[$blueprint_phid] = true;
    }

    return mpull($map, null, 'getPHID');
  }

  private function newAllowedBlueprintPHIDs(
    DrydockLease $lease,
    array $filter_blueprints) {
    assert_instances_of($filter_blueprints, 'DrydockBlueprint');

    $viewer = $this->getViewer();

    $impls = DrydockBlueprintImplementation::getAllForAllocatingLease($lease);

    if (!$impls) {
      throw new PhutilArgumentUsageException(
        pht(
          'No known blueprint class can ever allocate the specified '.
          'lease. Check that the resource type is spelled correctly.'));
    }

    $classes = array_keys($impls);

    $blueprints = id(new DrydockBlueprintQuery())
      ->setViewer($viewer)
      ->withBlueprintClasses($classes)
      ->withDisabled(false)
      ->execute();

    if (!$blueprints) {
      throw new PhutilArgumentUsageException(
        pht(
          'No enabled blueprints exist with a blueprint class that can '.
          'plausibly allocate resources to satisfy the requested lease.'));

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Fix the resource type spelling: the standard types are 'host' and 'working-copy' — verify with the blueprints you have and their implementation classes.
  2. If a custom type is intended, make sure its DrydockBlueprintImplementation subclass is present, final, registered, and returned by getAllBlueprintImplementations().
  3. Check the lease attributes (from --attributes) against what the implementation's canAllocateLease() expects.

Example fix

# before
bin/drydock lease --type hsot

# after
bin/drydock lease --type host
Defensive patterns

Strategy: validation

Validate before calling

$probe = id(new DrydockLease())->setResourceType($resource_type);
if ($attributes) {
  $probe->setAttributes($attributes);
}
$impls = DrydockBlueprintImplementation::getAllForAllocatingLease($probe);
if (!$impls) {
  throw new InvalidArgumentException(
    "No blueprint implementation can ever allocate '{$resource_type}'; ".
    'check the type spelling and attributes.');
}

Prevention

When it happens

Trigger: `bin/drydock lease --type hsot` (typo), `--type working-copy` on an install whose working-copy implementation is not available, or lease attributes that no implementation's canAllocateLease() accepts.

Common situations: Typos in resource type strings in scripts; requesting a custom resource type whose blueprint implementation class is not enabled in the install; attribute shape changes after upgrading.

Related errors


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