API trend.get for Elasticsearch empty results

XMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 7.0.26rc1, 7.4.10rc1, 8.0.0beta1 (master)
    • Component/s: API (A)
    • Environment:
      Elasticsearch 7.17.10
    • 0.5

      Steps to reproduce:

      1. Configure zabbix.conf.php
      2. Create item with value stored in Elasticsearch (value_type unsigned or float)
      3. Do API request below
      4. Check web server error log
      {
        "jsonrpc": "2.0",
          "method": "trend.get",
          "params": {
            "time_from": 1776329417,
            "limit": 1
          },
        "id": 1
      }
      

      Result:
      Web server error log:

      NOTICE: PHP message: PHP Warning:  Undefined array key "group_by_itemid" in include/classes/api/services/CTrend.php on line 296
      NOTICE: PHP message: PHP Warning:  Trying to access array offset on null in include/classes/api/services/CTrend.php on line 296
      NOTICE: PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in include/classes/api/services/CTrend.php on line 296
      

      Elastic search error (not visible in error log file):
      [bool] failed to parse field [must]
      Expected:
      No errors. API return trend data

            Assignee:
            Zabbix Development Team
            Reporter:
            Gregory Chalenko
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 1h
                1h