-
Problem report
-
Resolution: Fixed
-
Trivial
-
4.0.13rc1, 4.2.7rc1, 4.4 (plan)
-
Sprint 56 (Sep 2019), Sprint 57 (Oct 2019)
-
0.125
The error is reproduced for PHP 7.2.
Steps to reproduce:
1. Configure using Elasticsearch by adding the following lines to zabbix.conf.php:
global $HISTORY; // Elasticsearch url (can be string if same url is used for all types). $HISTORY['url'] = [ 'uint' => 'http://localhost:9200', 'text' => 'http://localhost:9200' ]; // Value types stored in Elasticsearch. $HISTORY['types'] = ['uint', 'text'];
2. Create host;
3. Create any item;
4. Edit this item;
5. Click on button "Clear history and trends"
Result:
Cannot clear history
count(): Parameter must be an array or an object that implements Countable [items.php:910 → CHistoryManager->deleteHistory() → CHistoryManager->deleteHistoryFromElasticsearch() in include\classes\api\managers\CHistoryManager.php:765] file_get_contents(http://localhost:9200/uint*/values/_delete_by_query?scroll=10s): failed to open stream: No connection could be made because the target machine actively refused it. [items.php:910 → CHistoryManager->deleteHistory() → CHistoryManager->deleteHistoryFromElasticsearch() → CElasticsearchHelper::query() → CElasticsearchHelper::request() → file_get_contents() in include\classes\helpers\CElasticsearchHelper.php:58] Elasticsearch error: failed to parse JSON.