{"record":{"id":"af9e239fd91767a5","repo":"phacility/phabricator","slug":"no-almanac-service-type-s-exists","errorCode":null,"errorMessage":"No Almanac service type \"%s\" exists!","messagePattern":"No Almanac service type \"(.+?)\" exists!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/almanac/storage/AlmanacService.php","lineNumber":31,"sourceCode":"    PhabricatorExtendedPolicyInterface {\n\n  protected $name;\n  protected $nameIndex;\n  protected $viewPolicy;\n  protected $editPolicy;\n  protected $serviceType;\n\n  private $almanacProperties = self::ATTACHABLE;\n  private $bindings = self::ATTACHABLE;\n  private $activeBindings = self::ATTACHABLE;\n  private $serviceImplementation = self::ATTACHABLE;\n\n  public static function initializeNewService($type) {\n    $type_map = AlmanacServiceType::getAllServiceTypes();\n\n    $implementation = idx($type_map, $type);\n    if (!$implementation) {\n      throw new Exception(\n        pht(\n          'No Almanac service type \"%s\" exists!',\n          $type));\n    }\n\n    return id(new AlmanacService())\n      ->setViewPolicy(PhabricatorPolicies::POLICY_USER)\n      ->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN)\n      ->attachAlmanacProperties(array())\n      ->setServiceType($type)\n      ->attachServiceImplementation($implementation);\n  }\n\n  protected function getConfiguration() {\n    return array(\n      self::CONFIG_AUX_PHID => true,\n      self::CONFIG_COLUMN_SCHEMA => array(\n        'name' => 'text128',","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/almanac/storage/AlmanacService.php#L13-L49","documentation":"AlmanacService::initializeNewService() validates the requested service type against AlmanacServiceType::getAllServiceTypes(), a registry map of installed service type implementations. An unknown type string means no installed class claims that key, so object initialization aborts before any row is created.","triggerScenarios":"Creating a service (UI, Conduit, or script) with serviceType set to a string that is not a key in getAllServiceTypes(); typically after a custom service type class was renamed, removed, or its defining phutil library stopped loading.","commonSituations":"Extension library not listed in phabricator.load-libraries after a deploy; renaming a custom AlmanacServiceType subclass but keeping old type strings in provisioning scripts; typo in a built-in type identifier.","solutions":["Inspect the valid type identifiers: var_export(array_keys(AlmanacServiceType::getAllServiceTypes())) and use one of those strings exactly.","For a missing custom type, confirm its class extends AlmanacServiceType, lives in a library listed under phabricator.load-libraries, and that the library loads cleanly on this host.","If the type class was renamed, update scripts/records to the new type string instead of re-adding the old class."],"exampleFix":"// before\n$service = AlmanacService::initializeNewService('custom.mytype'); // throws if unregistered\n\n// after\n$types = AlmanacServiceType::getAllServiceTypes();\nif (!isset($types['custom.mytype'])) {\n  throw new Exception('Type not registered; available: '.implode(', ', array_keys($types)));\n}\n$service = AlmanacService::initializeNewService('custom.mytype');","handlingStrategy":"validation","validationCode":"$type_map = AlmanacServiceType::getAllServiceTypes();\nif (!isset($type_map[$type])) {\n  throw new Exception(\n    \"Unknown service type '{$type}'. Registered types: \".\n    implode(', ', array_keys($type_map)));\n}\n$service = AlmanacService::initializeNewService($type);","typeGuard":"function isRegisteredAlmanacServiceType($type) {\n  return isset(AlmanacServiceType::getAllServiceTypes()[$type]);\n}","tryCatchPattern":"try {\n  $service = AlmanacService::initializeNewService($type);\n} catch (Exception $ex) {\n  // Fall back to reporting the registered types so the operator can correct input.\n  $known = implode(', ', array_keys(AlmanacServiceType::getAllServiceTypes()));\n  throw new Exception($ex->getMessage().\" Registered types: {$known}\");\n}","preventionTips":["Keep custom AlmanacServiceType classes in a dedicated library listed in phabricator.load-libraries.","Smoke-test getAllServiceTypes() keys after every deploy that touches extensions.","Never hardcode type strings in two places - centralize them in provisioning constants."],"tags":["almanac","service-type","registry","phabricator"],"backgroundTag":"unregistered-type-identifier","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}