Reviewed: https://reviews.mahara.org/2757 Committed: http://gitorious.org/mahara/mahara/commit/e2d208acb3616118e2ac3d7cbf1cecaf7a1eafb3 Submitter: Son Nguyen ([email protected]) Branch: master
commit e2d208acb3616118e2ac3d7cbf1cecaf7a1eafb3 Author: Robert Lyon <[email protected]> Date: Fri Nov 29 14:59:16 2013 +1300 Checking if elasticsearch can connect to host / port (bug #1256118) Currently the getConnection() in Elastica/Client.php can give false positive and also throws error if no connection. What is needed is a true/false check to allow for things like notice feedback on extensions page or giving a warning when switching to 'elasticsearch' on site options page when it is unreachable. Change-Id: I43506f03b943d79eb019d39fe794037fc50bd05a Signed-off-by: Robert Lyon <[email protected]> -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1256118 Title: elasticsearch install hangs if ElasticSearch Server not running Status in Mahara ePortfolio: In Progress Bug description: If you try to enable the elasticsearch search option in Configure site -> Site options -> Search settings when the ElasticSearch Server is not running it hangs on saving site options. There needs to be a report back to the screen that an error occurred like 'ElasticSearch Server is not running, please start service and try again' Actually for this to work we'd need to check if it is running before letting them choose it - because the site option is saved before the failure so coming back to the page it shows the search is set to 'elasticsearch' which is incorrect. The error log has errors like this: [WAR] 15 (lib/errors.php:448) An exception was thrown of class Elastica\\Exception\\ClientException. , referer: http://mahara-testing/admin/site/options.php [WAR] 15 (lib/errors.php:448) THIS IS BAD and should be changed to something extending MaharaException,, referer: http://mahara-testing/admin/site/options.php [WAR] 15 (lib/errors.php:448) unless the exception is from a third party library., referer: http://mahara-testing/admin/site/options.php [WAR] 15 (lib/errors.php:448) Original trace follows, referer: http://mahara-testing/admin/site/options.php [WAR] 15 (lib/elastica/lib/Elastica/Client.php:431) No enabled connection, referer: http://mahara-testing/admin/site/options.php Call stack (most recent first):, referer: http://mahara-testing/admin/site/options.php * Elastica\\Client->getConnection() at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/elastica/lib/Elastica/Client.php:530, referer: http://mahara-testing/admin/site/options.php * Elastica\\Client->request("mahara/", "DELETE", array(size 0), array(size 0)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/elastica/lib/Elastica/Client.php:551, referer: http://mahara-testing/admin/site/options.php * Elastica\\Client->request("mahara/", "DELETE", array(size 0), array(size 0)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/elastica/lib/Elastica/Index.php:405, referer: http://mahara-testing/admin/site/options.php * Elastica\\Index->request("", "DELETE") at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/elastica/lib/Elastica/Index.php:133, referer: http://mahara-testing/admin/site/options.php * Elastica\\Index->delete() at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/elastica/lib/Elastica/Index.php:184, referer: http://mahara-testing/admin/site/options.php * Elastica\\Index->create(array(size 3), true) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/search/elasticsearch/lib.php:1363, referer: http://mahara-testing/admin/site/options.php * ElasticsearchIndexing::create_index() at /home/robertl/htdocs/mahara-testing/mahara/htdocs/search/elasticsearch/lib.php:403, referer: http://mahara-testing/admin/site/options.php * PluginSearchElasticsearch::reset_all_searchtypes() at /home/robertl/htdocs/mahara-testing/mahara/htdocs/search/elasticsearch/lib.php:371, referer: http://mahara-testing/admin/site/options.php * PluginSearchElasticsearch::initialize_sitewide() at Unknown:0, referer: http://mahara-testing/admin/site/options.php * call_user_func_array(array(size 2), array(size 0)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/mahara.php:1453, referer: http://mahara-testing/admin/site/options.php * call_static_method("PluginSearchElasticsearch", "initialize_sitewide") at /home/robertl/htdocs/mahara-testing/mahara/htdocs/admin/site/options.php:763, referer: http://mahara-testing/admin/site/options.php * siteoptions_submit(object(Pieform), array(size 65)) at Unknown:0, referer: http://mahara-testing/admin/site/options.php * call_user_func_array("siteoptions_submit", array(size 2)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:528, referer: http://mahara-testing/admin/site/options.php * Pieform->__construct(array(size 7)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:170, referer: http://mahara-testing/admin/site/options.php * Pieform::process(array(size 7)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:71, referer: http://mahara-testing/admin/site/options.php * pieform(array(size 7)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/admin/site/options.php:673, referer: http://mahara-testing/admin/site/options.php To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1256118/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

