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

'abs()' TypeError appears if string value is passed in item Units field

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Duplicate
    • Icon: Critical Critical
    • None
    • 7.0.0beta3
    • Frontend (F)

      Steps to reproduce:

      • Create host with item:
        -) key -> vm.memory.size[available]
        -) Units -> B
        -) Start server and collect some data
        -) Check latest data

      Result: Type error appears if string value is passed in Units field. Unit conversion doesn't work.

      TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in /home/zabbix/workspace/master/ui/include/func.inc.php:814
      Stack trace:
      #0 /home/zabbix/workspace/master/ui/include/func.inc.php(814): abs()
      #1 /home/zabbix/workspace/master/ui/include/items.inc.php(1169): convertUnitsRaw()
      #2 /home/zabbix/workspace/master/ui/include/items.inc.php(1132): formatHistoryValueRaw()
      #3 /home/zabbix/workspace/master/ui/app/partials/monitoring.latest.view.html.php(152): formatHistoryValue()
      #4 /home/zabbix/workspace/master/ui/include/classes/mvc/CPartial.php(109): include('...')
      #5 /home/zabbix/workspace/master/ui/app/views/monitoring.latest.view.refresh.php(28): CPartial->getOutput()
      #6 /home/zabbix/workspace/master/ui/include/classes/mvc/CView.php(133): include('...')
      #7 /home/zabbix/workspace/master/ui/include/classes/core/ZBase.php(725): CView->getOutput()
      #8 /home/zabbix/workspace/master/ui/include/classes/core/ZBase.php(649): ZBase->processResponseFinal()
      #9 /home/zabbix/workspace/master/ui/include/classes/core/ZBase.php(233): ZBase->processRequest()
      #10 /home/zabbix/workspace/master/ui/include/config.inc.php(25): ZBase->run()
      #11 /home/zabbix/workspace/master/ui/zabbix.php(22): require_once('...')
      #12 {main}
      

      Expected: Unit conversion should work without errors.

            zabbix.dev Zabbix Development Team
            kseve Kirils Seve
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: