Details

      Description

      Zabbix has problems importing templates in JSON format. XML works without problems.

      If one use the zabbix API to export a template in JSON format (check attachment:zabbix_export_template.json) , the system will not be able to import this export file via the API or the frontend.

      The error we get via de API is: "... Application error.: Invalid XML tag "/zabbix_export/groups": unexpected tag "0". while sending ...."

      Via the frontend the error is: "...Invalid XML tag "/zabbix_export/groups": unexpected tag "0"...."

      According to the documentation this should work, "Import supports both XML and JSON, the import file must have a correct file extension: .xml for XML and .json for JSON.".

      I addition, when trying to import via the API, we use "format":"json" to specify that the file is a json file. (Check attachment with full information about json data send to the API: json_data_send_to_api.txt)

      It looks like the system doesn't discover that we are sending JSON data, try to parse de content as XML and fails.

      Any ideas on how to fix this? Thanks.

      1. json_data_send_to_api.txt
        4 kB
        Rafael Martinez
      2. zabbix_export_template.json
        3 kB
        Rafael Martinez

        Issue Links

          Activity

          Hide
          vitalijs.cemeris added a comment - - edited

          (1) Argument type error while importing incorrect json source. RESOLVED in r59895

          Alexander Vladishev CLOSED

          Show
          vitalijs.cemeris added a comment - - edited (1) Argument type error while importing incorrect json source. RESOLVED in r59895 Alexander Vladishev CLOSED
          Hide
          vitalijs.cemeris added a comment - - edited

          (2) Translation strings changes

          Strings added:

          • Cannot read JSON: %1$s.
          • Invalid tag "%1$s": %2$s.

          Strings deleted:

          • Invalid XML tag "%1$s": %2$s.

          Alexander Vladishev Updated translation strings. RESOLVED
          vitalijs.cemeris CLOSED

          Show
          vitalijs.cemeris added a comment - - edited (2) Translation strings changes Strings added: Cannot read JSON: %1$s. Invalid tag "%1$s": %2$s. Strings deleted: Invalid XML tag "%1$s": %2$s. Alexander Vladishev Updated translation strings. RESOLVED vitalijs.cemeris CLOSED
          Hide
          vitalijs.cemeris added a comment -

          RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-10607

          Show
          vitalijs.cemeris added a comment - RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-10607
          Hide
          Alexander Vladishev added a comment - - edited

          (3) Have a look at my changes in r59911.
          vitalijs.cemeris CLOSED

          Show
          Alexander Vladishev added a comment - - edited (3) Have a look at my changes in r59911. vitalijs.cemeris CLOSED
          Hide
          vitalijs.cemeris added a comment - - edited

          Fixed in:

          • pre-3.0.3rc1 59918
          • pre-3.1.0 59945
          Show
          vitalijs.cemeris added a comment - - edited Fixed in: pre-3.0.3rc1 59918 pre-3.1.0 59945
          Hide
          vitalijs.cemeris added a comment - - edited

          (4) API documentation:

          Alexander Vladishev CLOSED

          Show
          vitalijs.cemeris added a comment - - edited (4) API documentation: fixed validation of import in JSON format: Zabbix API changes in 3.0 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (5) trunk/frontends/php/include/classes/import/validators/C32XmlValidator.php:906 - translation string must be changed

          Invalid XML tag "%1$s": %2$s. => Invalid tag "%1$s": %2$s.

          vitalijs.cemeris RESOLVED in r59977

          Alexander Vladishev TESTED

          Alexander Vladishev Fixed in pre-3.1.0 (trunk) r59989

          CLOSED

          Show
          Alexander Vladishev added a comment - - edited (5) trunk/frontends/php/include/classes/import/validators/C32XmlValidator.php:906 - translation string must be changed Invalid XML tag "%1$s": %2$s. => Invalid tag "%1$s": %2$s. vitalijs.cemeris RESOLVED in r59977 Alexander Vladishev TESTED Alexander Vladishev Fixed in pre-3.1.0 (trunk) r59989 CLOSED

            People

            • Assignee:
              Unassigned
              Reporter:
              Rafael Martinez
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: