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

SQL errors during import from 5.0 to 5.4 and 6.0

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.4.4, 6.0.0alpha1
    • API (A)

      1. Create template and host on Zabbix 5.0;
      2. export them;
      3. in 5.4 open template import and try to import hosts.xml;
      4. observe the loader spins forever. SQL errors are visible in log;
      5. same thing with host import when trying to import templates.xml;
      6. do the same in 6.0 and observe same errors occur. Only now SQL errors are visible in import form:
      Example error

      pg_query(): Query failed: ERROR: invalid input syntax for integer: ""
          LINE 1: ... FROM items i WHERE i.flags IN (0,4) AND i.hostid='' AND i.k...
          ^ [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerPopupImport->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CConfiguration->import() → CConfigurationImport->import() → CConfigurationImport->processItems() → CConfigurationImport->getItemsOrder() → CConfigurationImport->getEntitiesOrder() → CItem->get() → DBselect() → pg_query() → CConfigFile->{closure}() in conf\zabbix.conf.php:108]
          Error in query [SELECT i.itemid,i.uuid,i.key_,i.type,i.hostid,i.master_itemid FROM items i WHERE i.flags IN (0,4) AND i.hostid='' AND i.key_='5_0_agent_log'] [ERROR: invalid input syntax for integer: ""
          LINE 1: ... FROM items i WHERE i.flags IN (0,4) AND i.hostid='' AND i.k...
          ^]
          pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerPopupImport->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CConfiguration->import() → CConfigurationImport->import() → CConfigurationImport->processTriggers() → CImportReferencer->findTriggeridByName() → CImportReferencer->selectTriggers() → CTrigger->get() → CApiService->customFetch() → DBselect() → pg_query() → CConfigFile->{closure}() in conf\zabbix.conf.php:108]
          Error in query [SELECT t.triggerid,t.uuid,t.description,t.expression,t.recovery_expression FROM triggers t WHERE t.flags IN (0,2,4)] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
          pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerPopupImport->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CConfiguration->import() → CConfigurationImport->import() → CConfigurationImport->processTriggers() → CImportReferencer->findTriggeridByName() → CImportReferencer->selectTriggers() → CTrigger->get() → CApiService->customFetch() → DBselect() → pg_query() → CConfigFile->{closure}() in conf\zabbix.conf.php:108]
          Error in query [SELECT t.triggerid,t.uuid,t.description,t.expression,t.recovery_expression FROM triggers t WHERE (t.description IN ('5_0_trigger_clone_with_dep_prot','5_0_trigger_prot','5_0_trigger','5_0_trigger_clone_with_dep')) AND t.flags IN (0,2,4)] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
          pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerPopupImport->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CConfiguration->import() → CConfigurationImport->import() → CConfigurationImport->processTriggers() → CTrigger->create() → CTriggerGeneral->validateCreate() → CTriggerGeneral->populateHostIds() → DBselect() → pg_query() → CConfigFile->{closure}() in conf\zabbix.conf.php:108]
          Error in query [SELECT h.hostid,h.host,h.status FROM hosts h WHERE h.host='zabbix_5_0_export_host' AND h.status IN (0,1,3)] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
          Incorrect trigger expression. Host "zabbix_5_0_export_host" does not exist or you have no access to this host. [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerPopupImport->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CConfiguration->import() → CConfigurationImport->import() → CConfigurationImport->processTriggers() → CTrigger->create() → CTriggerGeneral->validateCreate() → CTriggerGeneral->populateHostIds() → CApiService::exception() in include\classes\api\services\CTriggerGeneral.php:589]
      

            zabbix.dev Zabbix Development Team
            iivs Ivo Kurzemnieks
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: