Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19457

query failed when updating application names longer than 255 chars

    XMLWordPrintable

Details

    • Team B
    • Sprint 77 (Jun 2021), Sprint 78 (Jul 2021), Sprint 79 (Aug 2021), Sprint 80 (Sep 2021), Sprint 81 (Oct 2021)
    • 0.5

    Description

      To reproduce, import provided host XML, have zabbix agent working locally, download JSON file to /tmp folder and watch zabbix_server.log.
      Soon you will see errors like:

      930900:20210525:191940.638 [Z3005] query failed: [1062] Duplicate entry '10434-256-chars-loooooooooooooooooooooooooooooooooooooooooooo...' for key 'applications_2' [insert into applications (applicationid,hostid,name,flags) values (2148,10434,'256-chars-loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong',4);
      ]
      

      This should not happen. For item name, where in DB its also limited by 255 chars, is a check in zabbix code, so such item will not be created and LLD rule will show nice error:

      Cannot create item: value "your loo...ong item name ..." is too long.
      

      I believe similar check should be performed for applications too.

      Attached also debug log for LLD workers, where such application added (magically trimmed by zabbix 1 char (X) at end).
      After 2 seconds I forced execution for the LLD rule again, which caused the the duplicated SQL generation and unique index error. Then the SQL error is repeating every time when LLD rule is executed.
      LLD rule does not show any error in frontend in such case.

      This is simplified scenario to reproduce.
      On a real installation it happened for SNMP interfaces LLD rule, where application prototype is "Interface {#IFNAME}({#IFALIAS})"
      Because of {#IFALIAS} real macro value is ~250+ characters long, resulted application name was longer than 255 chars.

      This issue also should be checked for item tags in 5.4 (I did not check), where we replaced applications by tags. Tags are also 255 chars long only.

      Attachments

        1. json
          0.4 kB
        2. screenshot-1.png
          screenshot-1.png
          14 kB
        3. zabbix_server-255.log
          66 kB
        4. zbx_export_hosts-255-chars-app.xml
          2 kB

        Activity

          People

            asestakovs Aleksejs Sestakovs
            zalex_ua Oleksii Zagorskyi
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: