elasticsearch install hangs if ElasticSearch Server not running
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Mahara |
High
|
Robert Lyon | ||
| 1.8 |
High
|
Robert Lyon |
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.
[WAR] 15 (lib/errors.
[WAR] 15 (lib/errors.
[WAR] 15 (lib/errors.
[WAR] 15 (lib/elastica/
Call stack (most recent first):, referer: http://
* Elastica\
* Elastica\
* Elastica\
* Elastica\
* Elastica\
* Elastica\
* ElasticsearchIn
* PluginSearchEla
* PluginSearchEla
* call_user_
* call_static_
* siteoptions_
* call_user_
* Pieform-
* Pieform:
* pieform(array(size 7)) at /home/robertl/
Robert Lyon (robertl-9) wrote : | #1 |
Changed in mahara: | |
assignee: | nobody → Robert Lyon (robertl-9) |
Changed in mahara: | |
status: | Confirmed → In Progress |
Robert Lyon (robertl-9) wrote : | #2 |
https:/
I have added a function in elasticsearch to check to see if one can connect to the host/port with the given elasticsearch host and port details.
I tried using the inbuilt Elastica functions like getConnection() or isEnabled() to achieve a similar thing but there was instances where I could generate false positives / negatives if I ran
sudo /etc/init.
or
sudo /etc/init.
After certain pages had already loaded
The inbuilt checks seem to be one page load behind actual state.
Reviewed: https:/
Committed: http://
Submitter: Son Nguyen (<email address hidden>)
Branch: master
commit e2d208acb361611
Author: Robert Lyon <email address hidden>
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: I43506f03b943d7
Signed-off-by: Robert Lyon <email address hidden>
Robert Lyon (robertl-9) wrote : | #4 |
Added patch for v1.8
https:/
Changed in mahara: | |
status: | In Progress → Fix Committed |
Mahara Bot (dev-mahara) wrote : | #5 |
Reviewed: https:/
Committed: http://
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.8_STABLE
commit 6bfa2f9d01ddae4
Author: Robert Lyon <email address hidden>
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: I43506f03b943d7
Signed-off-by: Robert Lyon <email address hidden>
Changed in mahara: | |
status: | Fix Committed → Fix Released |
What is needed is a function like ch_server_ available( )
is_elasticsear
Which checks to see if a connection can be made to the ElasticSearch Server - returning true/false
That way we could use it in places like admin/extension s/pluginconfig. php?plugintype= search& pluginname= elasticsearch to complement the "The Elasticsearch plugin is currently active." message with something like "The Elasticsearch Server is/is not currently reachable".
And we could use it on search/ elasticsearch/ index.php to suppress the "An exception was thrown of class Elastica\ Exception\ ClientException . No enabled connection" warnings if the ElasticSearch Server is not able to be accessed.
We could instead have a "We were unable to process your search - please try again. If the problem persists please contact your administrator" message for the page.