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

Adding a passive proxy fails with a foreign key restraint error

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.2.0
    • Installation (I), Proxy (P)
    • None
    • Centos 6.5, x86_64

      I was previously running Zabbix 2.0 from epel. I upgraded to Zabbix 2.2 from the official Zabbix repo, and everything worked smoothly except that my passive proxy stopped working. I tried upgrading it to 2.2 and the problem persists. Items grow in the queue area for that proxy and are never updated. I do not see any errors in the zabbix_server.log. In the zabbix_proxy.log I get this DB error after it is added in the server web ui:

      513:20131206:132447.313 [Z3005] query failed: [1451] Cannot delete or update a parent row: a foreign key constraint fails (`zabbix_proxy`.`host_discovery`, CONSTRAINT `c_host_discovery_3` FOREIGN KEY (`parent_itemid`) REFERENCES `items` (`itemid`)) [delete from items where (itemid between 10055 and 10059 or itemid between 22700 and 22744 or itemid between 22755 and 22789 or itemid between 22796 and 22846 or itemid between 22851 and 22863 or itemid between 22867 and 22886 or itemid between 22891 and 22903 or itemid between 22907 and 22914 or itemid between 22920 and 22924 or itemid between 22938 and 22954 or itemid between 22980 and 22994 or itemid between 22996 and 23005 or itemid between 23011 and 23036 or itemid between 23058 and 23063 or itemid between 23067 and 23078 or itemid between 23108 and 23131 or itemid between 23134 and 23138 or itemid between 23158 and 23165 or itemid between 23167 and 23329 or itemid between 23340 and 23360 or itemid between 23542 and 23569 or itemid between 23575 and 23579 or itemid between 23595 and 23608 or itemid between 23628 and 23659 or itemid in (10009,10010,10013,10014,10016,10019,10020,10025,10026,10030,17318,17350,17352,17354,17356,17358,17360,17362,22181,22183,22185,22187,22189,22191,22196,22199,22219,22231,22232,22396,22399,22400,22401,22402,22404,22406,22408,22410,22412,22414,22416,22418,22420,22422,22424,22426,22428,22430,22444,22446,22448,22450,22452,22454,22456,22458,22665,22668,22671,22674,22677,22680,22683,22686,22689,22746,22749,22793,22848,22888,22917,22918,22933,22934,22961,22962,22963,22965,22968,22971,22972,22973,22974,22978,23007,23039,23041,23042,23043,23053,23054,23140,23143,23144,23145,23147,23148,23149,23150,23540,23572,23573,23585,23586,23587,23588,23593,23620,23625))]
      

      I tried upgrading the proxy to 2.2 but this did not help.

      I did have one other problem during the upgrade that may be related. I had disabled an item/trigger in the default Linux template. This caused a duplicate key error when it tried to upgrade. I deleted the template entirely and reimported the default Linux template to resolve this.

      I read a similar ticket: ZBX-5288. I ran the foreign key checker on the proxy linked on stack overflow and it did not return any rows.

      MySQL is version 5.1.71.

      I have tried deleting all of the servers referencing this proxy on the server, deleting the template they use, deleting the proxy, and then dumping the the entire zabbix_proxy database on the proxy, and re-adding everything and I run into the same error. Any suggestions would be appreciated.

      This is the output of the table that seems to have the foreign key constraint:

      mysql> select * from host_discovery left join items on host_discovery.parent_itemid = items.itemid  \G                               
      *************************** 1. row ***************************
                     hostid: 10090                                                                                                                                                    [57/76304]
              parent_hostid: NULL
              parent_itemid: 23542
                       host: 
                  lastcheck: 0
                  ts_delete: 0
                     itemid: 23542
                       type: 3
             snmp_community: 
                   snmp_oid: 
                     hostid: 10088
                       name: Discover VMware VMs
                       key_: vmware.vm.discovery[{$URL}]
                      delay: 3600
                    history: 90
                     trends: 365
                     status: 0
                 value_type: 4
              trapper_hosts: 
                      units: 
                 multiplier: 0
                      delta: 0
        snmpv3_securityname: 
       snmpv3_securitylevel: 0
      snmpv3_authpassphrase: 
      snmpv3_privpassphrase: 
                    formula: 1
                      error: 
                lastlogsize: 0
                 logtimefmt: 
                 templateid: NULL
                 valuemapid: NULL
                 delay_flex: 
                     params: 
                ipmi_sensor: 
                  data_type: 0
                   authtype: 0
                   username: {$USERNAME}
                   password: {$PASSWORD}
                  publickey: 
                 privatekey: 
                      mtime: 0
                      flags: 1
                     filter: :
                interfaceid: NULL
                       port: 
                description: Discovery of guest virtual machines.
             inventory_link: 0
                   lifetime: 30
        snmpv3_authprotocol: 0
        snmpv3_privprotocol: 0
                      state: 0
         snmpv3_contextname: 
                      state: 0                                                                                                                                                         [6/76304]
         snmpv3_contextname: 
      *************************** 2. row ***************************
                     hostid: 10092
              parent_hostid: NULL
              parent_itemid: 23554
                       host: 
                  lastcheck: 0
                  ts_delete: 0
                     itemid: 23554
                       type: 3
             snmp_community: 
                   snmp_oid: 
                     hostid: 10088
                       name: Discover VMware hypervisors
                       key_: vmware.hv.discovery[{$URL}]
                      delay: 3600
                    history: 90
                     trends: 365
                     status: 0
                 value_type: 4
              trapper_hosts: 
                      units: 
                 multiplier: 0
                      delta: 0
        snmpv3_securityname: 
       snmpv3_securitylevel: 0
      snmpv3_authpassphrase: 
      snmpv3_privpassphrase: 
                    formula: 1
                      error: 
                lastlogsize: 0
                 logtimefmt: 
                 templateid: NULL
                 valuemapid: NULL
                 delay_flex: 
                     params: 
                ipmi_sensor: 
                  data_type: 0
                   authtype: 0
                   username: {$USERNAME}
                   password: {$PASSWORD}
                  publickey: 
                 privatekey: 
                      mtime: 0
                      flags: 1
                     filter: :
                interfaceid: NULL
                       port: 
                description: Discovery of hypervisors.
             inventory_link: 0
                   lifetime: 30
        snmpv3_authprotocol: 0
        snmpv3_privprotocol: 0
                      state: 0
         snmpv3_contextname: 
      2 rows in set (0.00 sec)
      

      Foreign key constraints are on and have never been disabled as far as I know. The server's mysql has no entries in host_discovery and I have never used this feature.

            Unassigned Unassigned
            trashcan pat l
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: