[ZBX-17165] Incorrect validation rules for 4.4 XML import Created: 2020 Jan 10  Updated: 2024 Apr 10  Resolved: 2020 Feb 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 4.4.4
Fix Version/s: 4.4.6rc1, 5.0.0alpha2, 5.0 (plan)

Type: Problem report Priority: Critical
Reporter: Ivo Kurzemnieks Assignee: Alexander Vladishev
Resolution: Fixed Votes: 1
Labels: import, validation, xml
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File validation.png    
Issue Links:
Causes
caused by ZBXNEXT-5228 Make template attributes optional Closed
Sub-task
part of ZBXNEXT-5709 Adopt Host API to export XML data str... Open
Team: Team B
Sprint: Sprint 60 (Jan 2020), Sprint 61 (Feb 2020)
Story Points: 0.25

 Description   

Zabbix version 4.4 export introduced constants and arrays. But the validation is done incorrectly.

Let's say we have 4.2 XML file with strings:

<tls_connect>4</tls_connect>
<tls_accept>5</tls_accept>

Importing to 4.2 here's what happens:
4.2 XML goes through the 4.2 validator validates them as strings. Then it moves to 4.4 convertor. The 4.4 convertor changes the version from 4.2 to 4.4 and changes the stings to arrays. The same as if we would have 4.4 XML. For example:

<tls_accept>
  <option>NO_ENCRYPTION</option>
  <option>TLS_CERTIFICATE</option>
</tls_accept>

Here's the problem. The 4.4 validator accepts and validates strings XML_STRING, but in order to validate this array, there is a preprocessor called tlsAcceptConstantPreprocessor(). It changes the array to string. And that is wrong. This also creates problems for the future convertors and validators. See attached image for reference. The 4.4 validator should accept arrays as input.

Host parameters like tls_accept is just one example. There are possibly more like this. Please check all XML validator preprocessors and parameters and make sure they accept the correct format.



 Comments   
Comment by Roberts Lataria (Inactive) [ 2020 Jan 15 ]

Resolved in development branch feature/ZBX-17165-4.5, feature/ZBX-17165-4.4.

Comment by Roberts Lataria (Inactive) [ 2020 Jan 31 ]

Fixed in:

Generated at Thu Apr 03 08:39:31 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.