[ZBX-26089] Runtime error appears, if adding label with more than 255 characters in Map->Properties->Advanced labels->Custom label Created: 2025 Feb 24  Updated: 2025 Mar 19

Status: READY TO DEVELOP
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Frontend (F)
Affects Version/s: 6.0.39rc1, 7.0.11rc1, 7.2.5rc1, 7.4.0beta1 (master)
Fix Version/s: 7.0.12rc1, 7.2.6rc1, 7.4.0beta1 (master)

Type: Problem report Priority: Trivial
Reporter: Nikita Gogolevs Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 0
Labels: label, labels, runtimeerror, sysmap
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: GIF File maps_custom_labels.gif    
Team: Team B
Sprint: Sprint candidates

 Description   

Steps to reproduce:

  1. Edit any existing map
  2. Check "Advanced labels"
  3. Select custom label for any of "Advanced labels" options
  4. Add text with more than 255 characters, for example:
    abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ !"§ $%& /() =?* '<> #|; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ !"§ $%& /() =?* '<> #|; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz.
    
  5. Update the map

Result:
Blank screen is displayed.
See video:

Runtime error:

DBException: Value "abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ !"§ $%& /() =?* '<> #|; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ !"§ $%& /() =?* '<> #|; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz." is too long for field "label_string_host" - 256 characters. Allowed length is 255 characters. in /home/zabbix/workspace/master/ui/include/classes/db/DB.php:70
Stack trace:
#0 /home/zabbix/workspace/master/ui/include/classes/db/DB.php(351): DB::exception()
#1 /home/zabbix/workspace/master/ui/include/classes/db/DB.php(566): DB::checkValueTypes()
#2 /home/zabbix/workspace/master/ui/include/classes/api/services/CMap.php(2148): DB::update()
#3 /home/zabbix/workspace/master/ui/include/classes/api/clients/CLocalApiClient.php(117): CMap->update()
#4 /home/zabbix/workspace/master/ui/include/classes/api/wrappers/CApiWrapper.php(101): CLocalApiClient->callMethod()
#5 /home/zabbix/workspace/master/ui/include/classes/api/wrappers/CApiWrapper.php(89): CApiWrapper->callClientMethod()
#6 /home/zabbix/workspace/master/ui/include/classes/api/wrappers/CFrontendApiWrapper.php(58): CApiWrapper->callMethod()
#7 /home/zabbix/workspace/master/ui/include/classes/api/wrappers/CApiWrapper.php(77): CFrontendApiWrapper->callMethod()
#8 /home/zabbix/workspace/master/ui/sysmaps.php(181): CApiWrapper->__call()
#9 {main}

Expected:
Validation should be present, user should see correct error message on the frontend or should not be possible to add text longer than 255 char.


Generated at Mon Mar 31 05:29:18 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.