phacility/phabricator · error · Exception

Blueprint type "%s" is unrecognized. Valid types are: %s.

Error message

Blueprint type "%s" is unrecognized. Valid types are: %s.

What it means

Thrown by DrydockBlueprintEditEngine right after the type check passes: the 'type' value given in a Conduit blueprint-create transaction is not a key in DrydockBlueprintImplementation::getAllBlueprintImplementations(). The message lists every valid type name, so a typo is the usual cause. Valid types correspond to registered blueprint implementations such as 'host' and 'working-copy' (plus any enabled in the install).

Source

Thrown at src/applications/drydock/editor/DrydockBlueprintEditEngine.php:73

    $type = null;
    foreach ($raw_xactions as $raw_xaction) {
      if ($raw_xaction['type'] !== 'type') {
        continue;
      }

      $type = $raw_xaction['value'];
    }

    if ($type === null) {
      throw new Exception(
        pht(
          'When creating a new Drydock blueprint via the Conduit API, you '.
          'must provide a "type" transaction to select a type.'));
    }

    $map = DrydockBlueprintImplementation::getAllBlueprintImplementations();
    if (!isset($map[$type])) {
      throw new Exception(
        pht(
          'Blueprint type "%s" is unrecognized. Valid types are: %s.',
          $type,
          implode(', ', array_keys($map))));
    }

    $impl = clone $map[$type];
    $this->setBlueprintImplementation($impl);

    return $this->newEditableObject();
  }

  protected function newEditableObjectForDocumentation() {
    // In order to generate the proper list of fields/transactions for a
    // blueprint, a blueprint's type needs to be known upfront, and there's
    // currently no way to pre-specify the type. Hardcoding an implementation
    // here prevents the fatal on the Conduit API page and allows transactions
    // to be edited.

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Read the valid list from the error message itself and use one of those exact strings (commonly 'host' or 'working-copy').
  2. If unsure, list registered implementations: the keys of DrydockBlueprintImplementation::getAllBlueprintImplementations() are authoritative for your install.
  3. If you expected a custom type, verify the implementing class is installed, final, and its implementation actually registers (check for load errors in the Phabricator daemon log).

Example fix

// before
array('type' => 'type', 'value' => 'hosts'),

// after
array('type' => 'type', 'value' => 'host'),
Defensive patterns

Strategy: validation

Validate before calling

$valid = DrydockBlueprintImplementation::getAllBlueprintImplementations();
if (!isset($valid[$type])) {
  throw new InvalidArgumentException(
    'Unknown blueprint type. Valid: '.implode(', ', array_keys($valid)));
}

Type guard

function isValidBlueprintType($type) {
  return isset(
    DrydockBlueprintImplementation::getAllBlueprintImplementations()[$type]);
}

Prevention

When it happens

Trigger: drydock.blueprint.edit with {'type': 'type', 'value': 'hosts'} or 'workspace' or any other unregistered implementation key. isset($map[$type]) fails and the exception enumerates the valid keys.

Common situations: Typos or pluralized type names ('hosts' instead of 'host'); scripts written against a fork that registers extra blueprint implementations being run against stock Phabricator; blueprint implementations disabled/unavailable in the target install.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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