{"record":{"id":"6740a46dcc3865f8","repo":"phacility/phabricator","slug":"blueprint-type-s-is-unrecognized-valid-types-a","errorCode":null,"errorMessage":"Blueprint type \"%s\" is unrecognized. Valid types are: %s.","messagePattern":"Blueprint type \"(.+?)\" is unrecognized\\. Valid types are: (.+?)\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/drydock/editor/DrydockBlueprintEditEngine.php","lineNumber":73,"sourceCode":"    $type = null;\n    foreach ($raw_xactions as $raw_xaction) {\n      if ($raw_xaction['type'] !== 'type') {\n        continue;\n      }\n\n      $type = $raw_xaction['value'];\n    }\n\n    if ($type === null) {\n      throw new Exception(\n        pht(\n          'When creating a new Drydock blueprint via the Conduit API, you '.\n          'must provide a \"type\" transaction to select a type.'));\n    }\n\n    $map = DrydockBlueprintImplementation::getAllBlueprintImplementations();\n    if (!isset($map[$type])) {\n      throw new Exception(\n        pht(\n          'Blueprint type \"%s\" is unrecognized. Valid types are: %s.',\n          $type,\n          implode(', ', array_keys($map))));\n    }\n\n    $impl = clone $map[$type];\n    $this->setBlueprintImplementation($impl);\n\n    return $this->newEditableObject();\n  }\n\n  protected function newEditableObjectForDocumentation() {\n    // In order to generate the proper list of fields/transactions for a\n    // blueprint, a blueprint's type needs to be known upfront, and there's\n    // currently no way to pre-specify the type. Hardcoding an implementation\n    // here prevents the fatal on the Conduit API page and allows transactions\n    // to be edited.","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/drydock/editor/DrydockBlueprintEditEngine.php#L55-L91","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the valid list from the error message itself and use one of those exact strings (commonly 'host' or 'working-copy').","If unsure, list registered implementations: the keys of DrydockBlueprintImplementation::getAllBlueprintImplementations() are authoritative for your install.","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)."],"exampleFix":"// before\narray('type' => 'type', 'value' => 'hosts'),\n\n// after\narray('type' => 'type', 'value' => 'host'),","handlingStrategy":"validation","validationCode":"$valid = DrydockBlueprintImplementation::getAllBlueprintImplementations();\nif (!isset($valid[$type])) {\n  throw new InvalidArgumentException(\n    'Unknown blueprint type. Valid: '.implode(', ', array_keys($valid)));\n}","typeGuard":"function isValidBlueprintType($type) {\n  return isset(\n    DrydockBlueprintImplementation::getAllBlueprintImplementations()[$type]);\n}","tryCatchPattern":null,"preventionTips":["Derive the type string from array_keys(DrydockBlueprintImplementation::getAllBlueprintImplementations()) instead of hardcoding it.","Treat the valid-types list in the error message as authoritative for the target install; it can differ between installs."],"tags":["drydock","phabricator","conduit","blueprint","type","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}