Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorElasticsearchSetupCheck.php
Show All 28 Lines | foreach ($services as $service) { | ||||
$engine = $host->getEngine(); | $engine = $host->getEngine(); | ||||
$index_exists = $engine->indexExists(); | $index_exists = $engine->indexExists(); | ||||
if ($index_exists) { | if ($index_exists) { | ||||
$index_sane = $engine->indexIsSane(); | $index_sane = $engine->indexIsSane(); | ||||
} | } | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
$summary = pht('Elasticsearch is not reachable as configured.'); | $summary = pht('Elasticsearch is not reachable as configured.'); | ||||
$message = pht( | $message = pht( | ||||
'Elasticsearch is configured (with the %s setting) but Phabricator'. | 'Elasticsearch is configured (with the %s setting) but %s'. | ||||
' encountered an exception when trying to test the index.'. | ' encountered an exception when trying to test the index.'. | ||||
"\n\n". | "\n\n". | ||||
'%s', | '%s', | ||||
phutil_tag('tt', array(), 'cluster.search'), | phutil_tag('tt', array(), 'cluster.search'), | ||||
PhabricatorPlatformSite::getName(), | |||||
phutil_tag('pre', array(), $ex->getMessage())); | phutil_tag('pre', array(), $ex->getMessage())); | ||||
$this->newIssue('elastic.misconfigured') | $this->newIssue('elastic.misconfigured') | ||||
->setName(pht('Elasticsearch Misconfigured')) | ->setName(pht('Elasticsearch Misconfigured')) | ||||
->setSummary($summary) | ->setSummary($summary) | ||||
->setMessage($message) | ->setMessage($message) | ||||
->addRelatedPhabricatorConfig('cluster.search'); | ->addRelatedPhabricatorConfig('cluster.search'); | ||||
return; | return; | ||||
Show All 14 Lines | foreach ($services as $service) { | ||||
->setSummary($summary) | ->setSummary($summary) | ||||
->setMessage($message); | ->setMessage($message); | ||||
} else if (!$index_sane) { | } else if (!$index_sane) { | ||||
$summary = pht( | $summary = pht( | ||||
'Elasticsearch index exists but needs correction.'); | 'Elasticsearch index exists but needs correction.'); | ||||
$message = pht( | $message = pht( | ||||
'Either the Phabricator schema for Elasticsearch has changed '. | 'Either the %s schema for Elasticsearch has changed '. | ||||
'or Elasticsearch created the index automatically. '. | 'or Elasticsearch created the index automatically. '. | ||||
'Use the following command to rebuild the index.'); | 'Use the following command to rebuild the index.', | ||||
PhabricatorPlatformSite::getName()); | |||||
$this | $this | ||||
->newIssue('elastic.broken-index') | ->newIssue('elastic.broken-index') | ||||
->setName(pht('Elasticsearch Index Schema Mismatch')) | ->setName(pht('Elasticsearch Index Schema Mismatch')) | ||||
->addCommand('./bin/search init') | ->addCommand('./bin/search init') | ||||
->setSummary($summary) | ->setSummary($summary) | ||||
->setMessage($message); | ->setMessage($message); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0