{"record":{"id":"cabdfc0669752a31","repo":"phacility/phabricator","slug":"invalid-search-engine-type-s-valid-types-are","errorCode":null,"errorMessage":"Invalid search engine type: %s. Valid types are: %s.","messagePattern":"Invalid search engine type: (.+?)\\. Valid types are: (.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/cluster/config/PhabricatorClusterSearchConfigType.php","lineNumber":49,"sourceCode":"            'type'      => 'string',\n            'hosts'     => 'optional list<map<string, wild>>',\n            'roles'     => 'optional map<string, wild>',\n            'port'      => 'optional int',\n            'protocol'  => 'optional string',\n            'path'      => 'optional string',\n            'version'   => 'optional int',\n          ));\n      } catch (Exception $ex) {\n        throw new Exception(\n          pht(\n            'Search engine configuration has an invalid service '.\n            'specification (at index \"%s\"): %s.',\n            $index,\n            $ex->getMessage()));\n      }\n\n      if (!array_key_exists($spec['type'], $engines)) {\n        throw new Exception(\n          pht(\n            'Invalid search engine type: %s. Valid types are: %s.',\n            $spec['type'],\n            implode(', ', array_keys($engines))));\n      }\n\n      if (isset($spec['hosts'])) {\n        foreach ($spec['hosts'] as $hostindex => $host) {\n          try {\n            PhutilTypeSpec::checkMap(\n              $host,\n              array(\n                'host'     => 'string',\n                'roles'     => 'optional map<string, wild>',\n                'port'      => 'optional int',\n                'protocol'  => 'optional string',\n                'path'      => 'optional string',\n                'version'   => 'optional int',","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigType.php#L31-L67","documentation":"The service's `type` value does not match any installed fulltext storage engine identifier. Engines are collected with PhutilClassMapQuery over PhabricatorFulltextStorageEngine subclasses — `mysql` is built in, and `elasticsearch` exists only when the PhabricatorElasticsearchExtension is present. The message lists the identifiers actually available in this install.","triggerScenarios":"Setting `'type' => 'Elasticsearch'` or `'elastic'` (identifiers are case-sensitive), or setting `'elasticsearch'` without the Elasticsearch extension installed/enabled. The check runs at config-save time via PhabricatorClusterSearchConfigType::validateValue.","commonSituations":"Configuring search before installing the extension that provides the engine; engine identifiers renamed across Phabricator versions; copying config snippets from blog posts with different casing.","solutions":["Use an identifier from the 'Valid types are' list in the error, exactly as printed.","For Elasticsearch, install/enable PhabricatorElasticsearchExtension first, then set `type => 'elasticsearch'`.","If no extension is intended, use the built-in `type => 'mysql'`."],"exampleFix":"// before\narray('type' => 'Elasticsearch'),\n// after (extension enabled)\narray('type' => 'elasticsearch'),","handlingStrategy":"validation","validationCode":"$valid = array_keys(\n  PhabricatorSearchService::loadAllFulltextStorageEngines());\nif (!in_array($spec['type'], $valid, true)) {\n  throw new Exception(\n    'Engine \"'.$spec['type'].'\" not installed. Valid: '.implode(', ', $valid));\n}","typeGuard":"function isInstalledSearchEngine($type) {\n  $engines = PhabricatorSearchService::loadAllFulltextStorageEngines();\n  return isset($engines[$type]);\n}","tryCatchPattern":null,"preventionTips":["Check the engine list (`bin/search` output or the Search Servers UI) before referencing a type in config.","Treat identifiers as case-sensitive exact strings: 'mysql', 'elasticsearch'.","Install and enable the Elasticsearch extension before, not after, writing cluster.search."],"tags":["php","phabricator","config","search","elasticsearch","validation"],"backgroundTag":"search-cluster-config-invalid","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}