Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16702

Error in comparison in the elastic search clearing history function

XMLWordPrintable

    • 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.

        1. Capture.PNG
          22 kB
          Vasily Goncharenko

            basilgon Vasily Goncharenko (Inactive)
            HunterCRS Alexander Shubin
            Team D
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: