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

Incorrect error message when remove host interface that already used by discovery rule

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 7.4.0beta1 (master)
    • None

      {}Steps to reproduce:{}
      1) Create and save Host with Zabbix agent interface.
      2) Open zabbix in one more tab.
      3) In tab_1 - open created host in edit form.
      4) In tab_2 navigate to created hosts Discovery rule page.
      5) Create discovery rule that use Host interface.
      6) In tab_2 - press Create discovery rule.
      7) In tab_1 (where Hosts open in edit form) remove added interface and press Update.

      Result:
      Error message. Too informative.

      pg_query(): Query failed: ERROR:  update or delete on table "interface" violates foreign key constraint "c_items_4" on table "items"
      DETAIL:  Key (interfaceid)=(33) is still referenced from table "items". [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerHostUpdate->doAction() -> CApiWrapper->__call() -> CFrontendApiWrapper->callMethod() -> CApiWrapper->callMethod() -> CApiWrapper->callClientMethod() -> CLocalApiClient->callMethod() -> CHost->update() -> CHost->updateForce() -> CHost->massUpdate() -> CHostInterface->replaceHostInterfaces() -> CHostInterface->delete() -> DB::delete() -> DBexecute() -> pg_query() -> CConfigFile->{closure}() in include/db.inc.php:255]
       

      Expected:
      Another type of error without sql

            zabbix.dev Zabbix Development Team
            smaklakovs Sergejs Maklakovs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: