phacility/phabricator · error · Exception

Blueprint "%s" (of type "%s") is not properly implemented: %

Error message

Blueprint "%s" (of type "%s") is not properly implemented: %s must actually allocate the resource it returns.

What it means

DrydockResourceUpdateWorker::activateResource() calls the blueprint's activateResource() and then verifies the resource actually became active (isActivatedResource() is set by DrydockResource::activateResource()). If the blueprint returned without activating, this exception fires. Note the message text is a copy of the allocation validator ('allocateResource()') even though it guards activation, which can mislead; the fix is in the blueprint's activateResource().

Source

Thrown at src/applications/drydock/worker/DrydockResourceUpdateWorker.php:189

    $blueprint->activateResource($resource);
    $this->validateActivatedResource($blueprint, $resource);

    $awaken_ids = $this->getTaskDataValue('awakenOnActivation');
    if (is_array($awaken_ids) && $awaken_ids) {
      PhabricatorWorker::awakenTaskIDs($awaken_ids);
    }
  }


  /**
   * @task activate
   */
  private function validateActivatedResource(
    DrydockBlueprint $blueprint,
    DrydockResource $resource) {

    if (!$resource->isActivatedResource()) {
      throw new Exception(
        pht(
          'Blueprint "%s" (of type "%s") is not properly implemented: %s '.
          'must actually allocate the resource it returns.',
          $blueprint->getBlueprintName(),
          $blueprint->getClassName(),
          'allocateResource()'));
    }

  }


/* -(  Releasing Resources  )------------------------------------------------ */


  /**
   * @task release
   */
  private function releaseResource(

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. End the blueprint's activateResource() with $resource->activateResource() on every success path.
  2. Throw on failure paths instead of returning quietly.
  3. Ignore the misleading 'allocateResource()' wording in the message; the validator runs after activation, not allocation.

Example fix

// before
public function activateResource(DrydockResource $resource) {
  $this->provisionStorage($resource);
  // missing $resource->activateResource()
}

// after
public function activateResource(DrydockResource $resource) {
  $this->provisionStorage($resource);
  $resource->activateResource();
}
Defensive patterns

Strategy: validation

Validate before calling

if (!$resource->isActivatedResource()) {
  throw new Exception(
    pht('activateResource() returned without activating; call $resource->activateResource().'));
}

Prevention

When it happens

Trigger: Custom blueprint activateResource() that does provisioning work but never calls $resource->activateResource(); calling it conditionally and returning on a skipped branch.

Common situations: Writing the activation step of a custom blueprint; porting a blueprint written before explicit activation existed; being misled by the 'allocateResource()' text in the message into fixing the wrong method.

Related errors


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