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

importing template gives error about item description

    Details

      Description

      Note that this template can be imported into 2.4.6 successfully.

      With a template from the zabbix wiki for cisco devices:

      https://www.zabbix.org/wiki/File:Template_Cisco_Catalyst_Switches-20141206.xml

      The error message is:

      Illegal string offset 'params' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Illegal string offset 'trapper_hosts' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Illegal string offset 'snmp_community' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Illegal string offset 'snmp_oid' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Illegal string offset 'snmp_port' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Illegal string offset 'snmpv3_securityname' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Illegal string offset 'snmpv3_securitylevel' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Illegal string offset 'snmpv3_authpassphrase' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Illegal string offset 'snmpv3_privpassphrase' [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() → CXmlImportReader->xmlToArray() in include/classes/import/readers/CXmlImportReader.php:102]
      Invalid XML tag "/zabbix_export/hosts/host(1)/items/item(1)": the tag "description" is missing.
      

        Activity

        Hide
        Alexander Vladishev added a comment -

        Thank you for a report.

        This XML file is incorrect and cannot be imported into 3.0.x. Under ZBX-7654 we introduced strict validation of XML files.

        In any case errors like 'Illegal string offset' must be fixed.

        Show
        Alexander Vladishev added a comment - Thank you for a report. This XML file is incorrect and cannot be imported into 3.0.x. Under ZBX-7654 we introduced strict validation of XML files. In any case errors like 'Illegal string offset' must be fixed.
        Hide
        Oleg Egorov added a comment -

        RESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-10413 r59068

        Show
        Oleg Egorov added a comment - RESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-10413 r59068
        Hide
        Oleg Egorov added a comment - - edited

        (1) [F] Translation strings

        Added translation strings:

        • unexpected text "%1$s"
        • Cannot read XML: %1$s.
        • XML is empty
        • %1$s [Line: %2$s | Column: %3$s]

        Removed translation strings:

        • XML file contains warning %1$s:
        • XML file contains error %1$s:
        • XML file contains fatal error %1$s:

        Alexander Vladishev Updated list of the strings. Please check.

        RESOLVED

        Oleg Egorov Updated list for (4). RESOLVED.

        Alexander Vladishev CLOSED

        Show
        Oleg Egorov added a comment - - edited (1) [F] Translation strings Added translation strings : unexpected text "%1$s" Cannot read XML: %1$s. XML is empty %1$s [Line: %2$s | Column: %3$s] Removed translation strings : XML file contains warning %1$s: XML file contains error %1$s: XML file contains fatal error %1$s: Alexander Vladishev Updated list of the strings. Please check. RESOLVED Oleg Egorov Updated list for (4). RESOLVED. Alexander Vladishev CLOSED
        Hide
        Alexander Vladishev added a comment - - edited

        (2) Handling of tags with same name as attribute is not resolved.

        Alexander Vladishev RESOLVED in r59074

        Oleg Egorov CLOSED

        Show
        Alexander Vladishev added a comment - - edited (2) Handling of tags with same name as attribute is not resolved. Alexander Vladishev RESOLVED in r59074 Oleg Egorov CLOSED
        Hide
        Alexander Vladishev added a comment - - edited

        (3) Fatal PHP error while reading this XML:

        <?xml version="1.0"?>
        <zabbix_export version="1.0" date="09.01.10" time="14.23">
            <host name="aaa">
                <name>Zabbix</name>p
                <item type="3" key="icmpping" value_type="3">
                </item>
            </host>
        </zabbix_export>
        

        Error message:

        Cannot use string offset as an array in include/classes/import/readers/CXmlImportReader.php on line 109, referer: conf.import.php?rules_preset=template&sid=...
        

        Alexander Vladishev RESOLVED in r59074

        Oleg Egorov CLOSED

        Show
        Alexander Vladishev added a comment - - edited (3) Fatal PHP error while reading this XML: <?xml version= "1.0" ?> <zabbix_export version= "1.0" date= "09.01.10" time= "14.23" > <host name= "aaa" > <name>Zabbix</name>p <item type= "3" key= "icmpping" value_type= "3" > </item> </host> </zabbix_export> Error message: Cannot use string offset as an array in include/classes/import/readers/CXmlImportReader.php on line 109, referer: conf.import.php?rules_preset=template&sid=... Alexander Vladishev RESOLVED in r59074 Oleg Egorov CLOSED
        Hide
        Oleg Egorov added a comment - - edited

        (4) Missed check for empty XML

        XMLReader::XML(): Empty string supplied as input [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → XMLReader->XML() in include\classes\import\readers\CXmlImportReader.php:53]
        XMLReader::read(): Load Data before trying to read [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xml_to_array() → XMLReader->read() in include\classes\import\readers\CXmlImportReader.php:70]
        Argument 1 passed to CXmlValidator::validate() must be of the type array, null given, called in C:\xampp\htdocs\ZBX-10413\frontends\php\include\classes\api\services\CConfiguration.php on line 79 and defined [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlValidator->validate() in include\classes\import\validators\CXmlValidator.php:50]
        Invalid XML tag "/": an array is expected. [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlValidator->validate() → CXmlValidatorGeneral->validate() → CXmlValidatorGeneral->validateData() → CXmlValidatorGeneral->validateArray() in include\classes\import\validators\CXmlValidatorGeneral.php:74]
        

        RESOLVED in r59089, please review

        Alexander Vladishev CLOSED

        Show
        Oleg Egorov added a comment - - edited (4) Missed check for empty XML XMLReader::XML(): Empty string supplied as input [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → XMLReader->XML() in include\classes\import\readers\CXmlImportReader.php:53] XMLReader::read(): Load Data before trying to read [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlImportReader->read() → CXmlImportReader->xml_to_array() → XMLReader->read() in include\classes\import\readers\CXmlImportReader.php:70] Argument 1 passed to CXmlValidator::validate() must be of the type array, null given, called in C:\xampp\htdocs\ZBX-10413\frontends\php\include\classes\api\services\CConfiguration.php on line 79 and defined [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlValidator->validate() in include\classes\import\validators\CXmlValidator.php:50] Invalid XML tag "/": an array is expected. [conf.import.php:173 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CXmlValidator->validate() → CXmlValidatorGeneral->validate() → CXmlValidatorGeneral->validateData() → CXmlValidatorGeneral->validateArray() in include\classes\import\validators\CXmlValidatorGeneral.php:74] RESOLVED in r59089, please review Alexander Vladishev CLOSED
        Hide
        Oleg Egorov added a comment -

        Fixed in pre-3.0.2rc1 r59100 and pre-3.1.0 (trunk) r59099.

        Show
        Oleg Egorov added a comment - Fixed in pre-3.0.2rc1 r59100 and pre-3.1.0 (trunk) r59099.
        Hide
        Paul afk added a comment -

        Hello,

        Iv you want to migrate from Zabbix 3.4 to Zabbix 3.2 here is a small script

        echo "#!/bin/bash
        replace "<version>3.4</version>" "<version>3.2</version>" – $1
        replace "<snmp_community/>" "<snmp_community/><multiplier>0</multiplier>" – $1
        replace "<snmpv3_contextname/>" "<snmpv3_contextname/><delta>0</delta>" – $1
        replace "<snmpv3_privpassphrase/>" "<snmpv3_privpassphrase/><formula>1</formula>" – $1
        replace "<ipmi_sensor/>" "<ipmi_sensor/><data_type>0</data_type>" – $1
        grep preprocessing $1 " > a

        ./a template.xml

        if <preprocessing> or <preprocessing/> tags appear, please remove them (also remove content inside these tags) from the .xml you want to import in Zabbix 3.2 webinterface
        Be aware to manually add on *Use custom multiplier* and *Store as* values from these tags

        Show
        Paul afk added a comment - Hello, Iv you want to migrate from Zabbix 3.4 to Zabbix 3.2 here is a small script echo "#!/bin/bash replace "<version>3.4</version>" "<version>3.2</version>" – $1 replace "<snmp_community/>" "<snmp_community/><multiplier>0</multiplier>" – $1 replace "<snmpv3_contextname/>" "<snmpv3_contextname/><delta>0</delta>" – $1 replace "<snmpv3_privpassphrase/>" "<snmpv3_privpassphrase/><formula>1</formula>" – $1 replace "<ipmi_sensor/>" "<ipmi_sensor/><data_type>0</data_type>" – $1 grep preprocessing $1 " > a ./a template.xml if <preprocessing> or <preprocessing/> tags appear, please remove them (also remove content inside these tags) from the .xml you want to import in Zabbix 3.2 webinterface Be aware to manually add on * Use custom multiplier * and * Store as * values from these tags

          People

          • Assignee:
            Unassigned
            Reporter:
            lamba
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: