-
Type:
Problem report
-
Resolution: Unresolved
-
Priority:
Major
-
None
-
Affects Version/s: 7.0.23rc1, 7.4.7rc1, 8.0.0alpha2
-
Component/s: Frontend (F)
If Elasticsearch is configured as a history provider but the service is down (unreachable), the Zabbix frontend throws PHP runtime errors instead of displaying a graceful warning or empty data.
Steps to reproduce:
- Configure Zabbix frontend to use Elasticsearch for history (/ui/conf/zabbix.conf.php), example:
$HISTORY['url'] = [ 'uint' => 'http://localhost:9200' ]; // Value types stored in Elasticsearch. $HISTORY['types'] = ['uint'];
- Stop the Elasticsearch service or provide a wrong/unreachable URL.
- Navigate to
- Monitoring -> Hosts -> Graphs.
- Dashboards widgets (e.g., Top Hosts).
- Latest data.
Result: PHP runtime errors appear.
file_get_contents(http://localhost:9200log*/_search): Failed to open stream: operation failed [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerLatestView->doAction() -> CControllerLatest->extendData() -> CHistoryManager->getLastValues() -> CHistoryManager->getLastValuesFromElasticsearch() -> CElasticsearchHelper::query() -> CElasticsearchHelper::request() -> file_get_contents() -> CConfigFile->{closure}() in include/classes/helpers/CElasticsearchHelper.php:53] file_get_contents(http://localhost:9200log*/_search): Failed to open stream: operation failed [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerLatestViewRefresh->doAction() -> CControllerLatest->extendData() -> CHistoryManager->getLastValues() -> CHistoryManager->getLastValuesFromElasticsearch() -> CElasticsearchHelper::query() -> CElasticsearchHelper::request() -> file_get_contents() -> CConfigFile->{closure}() in include/classes/helpers/CElasticsearchHelper.php:53]
Expected: The frontend should handle the connection failure gracefully. It should catch the exception and display a user-friendly error message within the widget or a notification at the top of the page, without breaking the PHP runtime.
Note: Elasticsearch's current error display breaks the host graphs page layout.
- duplicates
-
ZBX-27405 Runtime error appears when ElasticSearch is turned off
-
- Closed
-