Problem after upgrading ZABBIX between versions 7.4.2 and >7.4.3

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Major
    • None
    • Affects Version/s: 7.4.5
    • Component/s: Frontend (F)

      The transition between these versions caused me a problem with the "Update" button function when editing a guest, where the "update" button does not make any changes to the data.

      When you enable the analysis tool in the browser (F12), it is possible to partially identify the cause and the error message in which the text is "This value is not a valid integer".

      Truncated console output:

      /zabbix/zabbix.php?action=popup&popup=host.edit&hostid=100100000013706:1 Autofocus processing was blocked because a document already has a focused element.jsLoader.php?lang=en_GB&ver=7.4.5&showGuiMessaging=1:28547 {error: {…}}error: messages: /validations/0/exclude_id: Array(1)0: {message: 'This value is not a valid integer.', level: 0}length: 1[[Prototype]]: Array(0)/validations/1/exclude_id: [\{…}][[Prototype]]: Object[[Prototype]]: Object[[Prototype]]: Object(anonymous) @ jsLoader.php?lang=en_GB&ver=7.4.5&showGuiMessaging=1:28547Promise.catch#validateApiExists @ jsLoader.php?lang=en_GB&ver=7.4.5&showGuiMessaging=1:28546#validateApiUniqueness @ jsLoader.php?lang=en_GB&ver=7.4.5&showGuiMessaging=1:28584(anonymous) @ jsLoader.php?lang=en_GB&ver=7.4.5&showGuiMessaging=1:28144await in (anonymous)validateChanges @ jsLoader.php?lang=en_GB&ver=7.4.5&showGuiMessaging=1:28126#validate_changes_call @ jsLoader.php?lang=en_GB&ver=7.4.5&showGuiMessaging=1:27697setTimeout#listeners.mouseup @ jsLoader.php?lang=en_GB&ver=7.4.5&showGuiMessaging=1:27522

       

      By analyzing the changes and gradually discovering, I came to the conclusion that the change is in the Java script. "/usr/share/zabbix/ui/js/class.form.validator.js" - I replaced this script from version 7.4.2 where everything worked. The error will appear in versions higher than 7.4.2 up to the current 7.4.5

      So far I have found that the error only occurs when editing the host, other functions are functional. Cloning from the original host also works - a new host is created, but it is no longer possible to edit it.

      Data is stored in the Database:
      **

      mysql> select hostid,host,name,description from hosts where host like '%mgmt%';
      
      hostid host name description   
      100100000010084 mgmt02 mgmt02 d n sss   
      100100000013708 mgmt03 mgmt03 Test 4
      2 rows in set (0.00 sec)
      

       

      {{}}

      I found out the reason why Zabbix behaves this way only with my database, which is gradually upgraded from Zabbix version 1.x.

      The reason is the "hostid" structure in the database. When Zabbix supported Distributed Monitoring on Nodes from version 1.8 to 2.2, I used this concept with multiple nodes. At that time, the "hostid" format changed to e.g. "100100000010084" where the node identifier was added. Since version 2.4, this concept has been abolished, but the "hostid" in the database has not been converted to a shortened form.

      Interestingly, in the current version (7.4.5) the validator only works when editing a host. Cloning, creating and all other operations also work with the "hostid" structure from the days of distributed monitoring in the form "hostid" "100100000010084". From this I understand that "class.form.validator.js" is only called when editing a host.

      My attempt to edit/change "hostid" was also that in the exported dump database (MySQL) /configuration only, without historical data/ I shortened all hostids by cutting off 8 characters from the left and replacing the last one with "1"

      as follows:

      100100000010084

             V

             10010084

      After this change, "Update" also works with the 7.4.5 version of "class.form.validator.js"

      Data after conversion in the database:

      mysql> select hostid,host,name,description from hosts where host like '%mgmt%';

      hostid host name description
      10010084 mgmt02 mgmt02 d n sss
      10013708 mgmt03 mgmt03 Test 4

      2 rows in set (0.00 sec)

      Conversion of the entire database, including historical data, is not efficient using DBdump and subsequent import due to the size of the database, which is also partitioned and its size is approximately 230GB.

      Sorry, I'm not a programmer and I don't know what needs to be fixed in "class.form.validator.js", but based on my findings, this behavior could be considered a "BUG" and I would be happy if you could make a solution (fix) in the "class.form.validator.js" code based on my suggestion.

        1. ZBX745-bug_EN.pdf
          438 kB
        2. host_edit_01.png
          host_edit_01.png
          151 kB
        3. Cloned_host_edit_02.png
          Cloned_host_edit_02.png
          172 kB
        4. Clone_host.png
          Clone_host.png
          118 kB

            Assignee:
            Zabbix Development Team
            Reporter:
            Rudolf Pavlovic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: