[ZBX-24690] If the trigger description field contains a "line break" and a "-", the exported YAML format is incorrect. Created: 2024 Jun 20  Updated: 2025 Jan 22  Resolved: 2025 Jan 22

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 6.0.31
Fix Version/s: 6.0.38rc1, 7.0.9rc1, 7.2.3rc1, 7.4.0alpha1

Type: Problem report Priority: Trivial
Reporter: Itsuki Karimata Assignee: Gregory Chalenko
Resolution: Fixed Votes: 0
Labels: export, yaml
Remaining Estimate: Not Specified
Time Spent: 11h
Original Estimate: Not Specified
Environment:

Centos8Stream
MySQL8.0.26
Apache2.4.37
PHP 7.2.24
Zabbix 6.0.18+


Attachments: File broken_export.json     PNG File screenshot-1.png     PNG File screenshot-2.png    
Issue Links:
Causes
caused by ZBXNEXT-8078 Remove unnecessary new line for each ... Closed
Duplicate
Related
related to ZBXNEXT-9624 Add support for PHP 8.4 Closed
Team: Team C
Sprint: S24-W26/27, S24-W50/51/52/1, S25-W2/3
Story Points: 1

 Description   

This does not occur in XML, only in YAML format.
Occurred on 6.0.23 and 6.0.31.
This issue occurred with customers on 6.0.27 and 6.0.28.

Steps to reproduce:

  1. Duplicate the ICMP Ping template and leave only the following.
    • Item : ICMP ping
    • Trigger : Unavailable by ICMP ping
  2. Delete the trigger tag, add a line break and add - in the description field. (It will not be reproduced if you just put - at the end without line break)
  3. Delete all template macros
  4. Export the settings of the duplicated template in YAML format
  5. Delete the duplicated template
  6. Import the configuration file (YAML)

Result:
The following error is output

Details Import failed
Invalid tag "/zabbix_export/templates/template(1)/items/item(2)": unexpected tag "mappings". [zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerPopupImportCompare->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CConfiguration->importcompare() → CXmlValidator->validate() → C60XmlValidator->validate() → CXmlValidatorGeneral->doValidate() → CXmlValidatorGeneral->doValidateRecursive() → CXmlValidatorGeneral->doValidateRecursive() → CXmlValidatorGeneral->doValidateRecursive() → CXmlValidatorGeneral->doValidateRecursive() → CXmlValidatorGeneral->doValidateRecursive() in include/classes/import/validators/CXmlValidatorGeneral.php:234]

Expected:
Imported successfully


YAML output result

...
triggers:
- uuid: 01afbfccdf624240bfe6deef1c6f3791
  expression: 'max(/ICMP Ping_temp1/icmpping,#3)=0'
  name: 'Unavailable by ICMP ping'
  status: DISABLED
  priority: HIGH
  description: |
    Last three attempts returned timeout.  Please check device connectivity.
    - valuemaps:
- uuid: 2af9a2d53eec46d7b1a35f39685cdaed
...

Exported output with “-” changed to “test”

...
triggers:
- uuid: 01afbfccdf624240bfe6deef1c6f3791
  expression: 'max(/ICMP Ping_temp1/icmpping,#3)=0'
  name: 'Unavailable by ICMP ping'
  status: DISABLED
  priority: HIGH
  description: |
    Last three attempts returned timeout.  Please check device connectivity.
    test
valuemaps:
- uuid: 2af9a2d53eec46d7b1a35f39685cdaee
...


 Comments   
Comment by Gregory Chalenko [ 2025 Jan 08 ]

Resolved in feature/ZBX-24690-6.0.

Comment by Gregory Chalenko [ 2025 Jan 16 ]

Available in versions:

Generated at Sat Dec 13 22:28:04 EET 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.