diff --git a/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigOptionType.php b/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigOptionType.php --- a/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigOptionType.php +++ b/src/infrastructure/cluster/config/PhabricatorClusterSearchConfigOptionType.php @@ -4,7 +4,7 @@ extends PhabricatorConfigJSONOptionType { public function validateOption(PhabricatorConfigOption $option, $value) { - self::validateClusterSearchConfigValue($value); + self::validateValue($value); } public static function validateValue($value) { diff --git a/src/infrastructure/cluster/search/PhabricatorSearchService.php b/src/infrastructure/cluster/search/PhabricatorSearchService.php --- a/src/infrastructure/cluster/search/PhabricatorSearchService.php +++ b/src/infrastructure/cluster/search/PhabricatorSearchService.php @@ -186,6 +186,18 @@ $refs = array(); foreach ($services as $config) { + + // Normally, we've validated configuration before we get this far, but + // make sure we don't fatal if we end up here with a bogus configuration. + if (!isset($engines[$config['type']])) { + throw new Exception( + pht( + 'Configured search engine type "%s" is unknown. Valid engines '. + 'are: %s.', + $config['type'], + implode(', ', array_keys($engines)))); + } + $engine = $engines[$config['type']]; $cluster = new self($engine); $cluster->setConfig($config);