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

Error occurs when importing files with different interfaces and discovery

XMLWordPrintable

    • Sprint candidates
    • 1

      An error occurs when importing files with different interfaces and discovery in the first file.

      Steps to reproduce:
      1. Go to Hosts;
      2. Import first file zbx_export_hosts 1.yaml from attachments;
      3. Import second file zbx_export_hosts 2.yaml .

      Result:

      Error in logs:

      pg_query(): Query failed: ERROR:  update or delete on table "interface" violates foreign key constraint "c_items_4" on table "items"
      DETAIL:  Key (interfaceid)=(80) is still referenced from table "items". [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerPopupImport->doAction() -> CApiWrapper->__call() -> CFrontendApiWrapper->callMethod() -> CApiWrapper->callMethod() -> CApiWrapper->callClientMethod() -> CLocalApiClient->callMethod() -> CConfiguration->import() -> CConfigurationImport->import() -> CConfigurationImport->processHosts() -> CHostImporter->import() -> CHost->update() -> CHost->updateForce() -> CHost->massUpdate() -> CHostInterface->replaceHostInterfaces() -> CHostInterface->delete() -> DB::delete() -> DBexecute() -> pg_query() -> CConfigFile->{closure}() in include/db.inc.php:255]
      
      • If you delete the discovery from File 1 and leave the host empty, the error will not occur.
      • If you add an item instead , the system triggers the correct notification:

        1. screenshot-1.png
          screenshot-1.png
          96 kB
        2. screenshot-2.png
          screenshot-2.png
          70 kB
        3. zbx_export_hosts 1.yaml
          3 kB
        4. zbx_export_hosts 2.yaml
          0.6 kB

            zabbix.dev Zabbix Development Team
            jiljina Juliana Iljina
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: