[ZBX-10607] Problems importing JSON templates Created: 2016 Apr 01 Updated: 2019 Apr 12 Resolved: 2016 May 10 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A), Frontend (F), Templates (T) |
Affects Version/s: | 3.0.1 |
Fix Version/s: | 3.0.3rc1, 3.2.0alpha1 |
Type: | Incident report | Priority: | Minor |
Reporter: | Rafael Martinez | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | api, import, json | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Centos7, PostgreSQL-9.5.1, zabbix-3.0.1 |
Attachments: |
![]() ![]() |
||||||||||||||||
Issue Links: |
|
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. |
Comments |
Comment by vitalijs.cemeris (Inactive) [ 2016 May 05 ] |
(1) Argument type error while importing incorrect json source. RESOLVED in r59895 sasha CLOSED |
Comment by vitalijs.cemeris (Inactive) [ 2016 May 05 ] |
(2) Translation strings changes Strings added:
Strings deleted:
sasha Updated translation strings. RESOLVED |
Comment by vitalijs.cemeris (Inactive) [ 2016 May 05 ] |
RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-10607 |
Comment by Alexander Vladishev [ 2016 May 06 ] |
(3) Have a look at my changes in r59911. |
Comment by vitalijs.cemeris (Inactive) [ 2016 May 06 ] |
Fixed in:
|
Comment by vitalijs.cemeris (Inactive) [ 2016 May 09 ] |
(4) API documentation:
sasha CLOSED |
Comment by Alexander Vladishev [ 2016 May 09 ] |
(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 sasha TESTED sasha Fixed in pre-3.1.0 (trunk) r59989 CLOSED |