Error: TypeError: abs(): Argument #1 ($num) must be of type int|float in pie graph, when non-numerical value is passed with last function

XMLWordPrintable

    • S26-W06/07
    • 0.5

      Steps to reproduce:

      1. Start Zabbix server ang agent
      2. Import the host -> test-host.yaml
      3. Open Monitoring -> Hosts -> test -> graphs, validate that pie graph with function last is displayed
      4. Open Data collection -> Hosts -> test -> Items
      5. Open Item -> item1
      6. Change the Type of information to Text, add preprocessing (Regular expression):
        Parameters: 1
        Output: text
        
      7. Update the item
      8. Open Monitoring -> Hosts -> test -> graphs

      Result:
      Console error is displayed, graph is broken
      Error:

      TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in /home/zabbix/workspace/7.0/ui/include/classes/graphdraw/CPieGraphDraw.php:261
      Stack trace:
      #0 /home/zabbix/workspace/7.0/ui/include/classes/graphdraw/CPieGraphDraw.php(261): abs()
      #1 /home/zabbix/workspace/7.0/ui/include/classes/graphdraw/CPieGraphDraw.php(636): CPieGraphDraw->selectData()
      #2 /home/zabbix/workspace/7.0/ui/chart6.php(133): CPieGraphDraw->draw()
      #3 {main}
      

      See video:

      Expected:
      The expected result need to be confirmed with PO team. Currently the non-numeric data is passed for some functions of pie widget, which might cause the issues.
      Most likely "No data" should be displayed, when item's type of information is changed to non-numeric one.

        1. pie-graph-last-issue.gif
          687 kB
          Nikita Gogolevs
        2. test-host.yaml
          0.7 kB
          Nikita Gogolevs

            Assignee:
            Georgijs Klavins
            Reporter:
            Nikita Gogolevs
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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