ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7445

Frontend tries to take latest values while deleting host

    Details

    • Type: Incident report Incident report
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1rc1
    • Fix Version/s: 2.2.2rc1, 2.3.0
    • Component/s: API (A)
    • Labels:

      Description

      Steps to reproduce:
      1. Host with template: Template App Zabbix Server, Template OS Linux (Template App Zabbix Agent)
      2. Queries like:
      SQL (0.003269): (SELECT * FROM history h WHERE h.itemid='23252' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23253' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23254' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23255' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23256' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23257' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23258' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23259' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23260' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23261' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23262' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23263' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23264' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23265' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23266' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23267' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23268' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23269' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23270' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23273' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23274' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23275' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23276' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23296' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23301' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23310' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23328' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23620' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history h WHERE h.itemid='23635' ORDER BY h.clock DESC LIMIT 2 OFFSET 0)
      hosts.php:572 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CHost->delete() → CItem->delete() → CTrigger->get() → CTrigger->addRelatedObjects() → CItem->get() → CItem->addRelatedObjects() → CHistoryManager->getLast() → DBunion() → DBselect() in /var/www/zabbix/2.2/include/db.inc.php:525

      SQL (0.000574): (SELECT * FROM history_uint h WHERE h.itemid='23271' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history_uint h WHERE h.itemid='23287' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history_uint h WHERE h.itemid='23289' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history_uint h WHERE h.itemid='23290' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history_uint h WHERE h.itemid='23291' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history_uint h WHERE h.itemid='23292' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history_uint h WHERE h.itemid='23313' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history_uint h WHERE h.itemid='23315' ORDER BY h.clock DESC LIMIT 2 OFFSET 0) UNION ALL (SELECT * FROM history_uint h WHERE h.itemid='23316' ORDER BY h.clock DESC LIMIT 2 OFFSET 0)
      hosts.php:572 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CHost->delete() → CItem->delete() → CTrigger->get() → CTrigger->addRelatedObjects() → CItem->get() → CItem->addRelatedObjects() → CHistoryManager->getLast() → DBunion() → DBselect() in /var/www/zabbix/2.2/include/db.inc.php:525

        Activity

        Hide
        Eduards Samersovs added a comment -

        Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7445

        Show
        Eduards Samersovs added a comment - Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7445
        Hide
        Alexander Vladishev added a comment - - edited

        Successfully tested!

        Please review my changes in r40554.

        Eduards Samersovs CLOSED

        Show
        Alexander Vladishev added a comment - - edited Successfully tested! Please review my changes in r40554. Eduards Samersovs CLOSED
        Hide
        Eduards Samersovs added a comment -

        Fixed in versions 2.3.0 (trunk) r.40562, 2.2.1rc1 r.40561

        Show
        Eduards Samersovs added a comment - Fixed in versions 2.3.0 (trunk) r.40562, 2.2.1rc1 r.40561
        Hide
        Pavels Jelisejevs added a comment - - edited

        (1) There are some other places where we unnecessarily retrieve item history data, a couple of them:

        • forms.inc.php:1062 (using API_OUTPUT_EXTEND);
        • CEvent.php:170 (using API_OUTPUT_REFER by default).

        Please check all of the item.get calls and selectItems usages and make sure we don't use API_OUTPUT_EXTEND and API_OUTPUT_REFER anywhere.

        You can check out the changes in svn://svn.zabbix.com/branches/dev/ZBXNEXT-2017. I've removed most of the API_OUTPUT_REFER usages there, may be it will help you find the places that need to be fixed.

        Eduards Samersovs Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7445 r.40615

        Alexander Vladishev REOPENED

        • undefined indexes in popup.php:
          Undefined index: type [ in frontends/php/popup.php:884]
          Undefined index: value_type [ in frontends/php/popup.php:885]
          Undefined index: status [ in frontends/php/popup.php:886]
          Undefined index: state [ in frontends/php/popup.php:886]
          
        • getItemFormData() $options cannot be used here as local variable because it is used in parameters of this function
        • getItemFormData() redundant data in Item()->get()
          'error', 'lastlogsize', 'mtime', 'flags', 'state'
        • frontends/php/items.php:940 redundant data in Item()->get()
          'snmp_community', 'snmp_oid', 'trapper_hosts', 'units', 'multiplier', 'delta',
          'snmpv3_securityname', 'snmpv3_securitylevel', 'snmpv3_authpassphrase', 'snmpv3_privpassphrase',
          'formula', 'lastlogsize', 'logtimefmt', 'valuemapid', 'delay_flex', 'params',
          'ipmi_sensor', 'data_type', 'authtype', 'username', 'password', 'publickey', 'privatekey', 'mtime',
          'filter', 'interfaceid', 'port', 'description', 'inventory_link', 'lifetime',
          'snmpv3_authprotocol', 'snmpv3_privprotocol', 'snmpv3_contextname'
          
        • frontends/php/include/classes/import/CXmlImport18.php:1358 redundant data in Item()->get() array('itemid') will be enough

        Eduards Samersovs RESOLVED r.40736

        Alexander Vladishev CLOSED

        Please review my changes in r.40741 before a merge.

        Eduards Samersovs OK, CLOSED

        Show
        Pavels Jelisejevs added a comment - - edited (1) There are some other places where we unnecessarily retrieve item history data, a couple of them: forms.inc.php:1062 (using API_OUTPUT_EXTEND); CEvent.php:170 (using API_OUTPUT_REFER by default). Please check all of the item.get calls and selectItems usages and make sure we don't use API_OUTPUT_EXTEND and API_OUTPUT_REFER anywhere. You can check out the changes in svn://svn.zabbix.com/branches/dev/ZBXNEXT-2017. I've removed most of the API_OUTPUT_REFER usages there, may be it will help you find the places that need to be fixed. Eduards Samersovs Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7445 r.40615 Alexander Vladishev REOPENED undefined indexes in popup.php: Undefined index: type [ in frontends/php/popup.php:884] Undefined index: value_type [ in frontends/php/popup.php:885] Undefined index: status [ in frontends/php/popup.php:886] Undefined index: state [ in frontends/php/popup.php:886] getItemFormData() $options cannot be used here as local variable because it is used in parameters of this function getItemFormData() redundant data in Item()->get() 'error', 'lastlogsize', 'mtime', 'flags', 'state' frontends/php/items.php:940 redundant data in Item()->get() 'snmp_community', 'snmp_oid', 'trapper_hosts', 'units', 'multiplier', 'delta', 'snmpv3_securityname', 'snmpv3_securitylevel', 'snmpv3_authpassphrase', 'snmpv3_privpassphrase', 'formula', 'lastlogsize', 'logtimefmt', 'valuemapid', 'delay_flex', 'params', 'ipmi_sensor', 'data_type', 'authtype', 'username', 'password', 'publickey', 'privatekey', 'mtime', 'filter', 'interfaceid', 'port', 'description', 'inventory_link', 'lifetime', 'snmpv3_authprotocol', 'snmpv3_privprotocol', 'snmpv3_contextname' frontends/php/include/classes/import/CXmlImport18.php:1358 redundant data in Item()->get() array('itemid') will be enough Eduards Samersovs RESOLVED r.40736 Alexander Vladishev CLOSED Please review my changes in r.40741 before a merge. Eduards Samersovs OK, CLOSED
        Hide
        Eduards Samersovs added a comment -

        Fixed in versions 2.3.0 (trunk) r.40849, 2.2.2rc1 r.40848

        Show
        Eduards Samersovs added a comment - Fixed in versions 2.3.0 (trunk) r.40849, 2.2.2rc1 r.40848

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexey Pustovalov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: