Ad Widget

Collapse

Error when cloning stock template in 6.05

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nils2
    Junior Member
    • Apr 2011
    • 26

    #1

    Error when cloning stock template in 6.05

    I've just upgraded from 4.2 to 6.0 LTS (6.05). I've downloaded the original templates from the Zabbix git server, reconfigured some old hosts, etc. I wanted to customize the "Linux by Zabbix agent" template by making a full clone, but I'm always getting the following message:

    Cannot add template
    Invalid parameter "/2/pages/1/widgets/3/fields/2/value": a number is expected.

    Can anyone tell me what's happening? Is this a bug in Zabbix 6.05?
  • Answer selected by nils2 at 11-06-2022, 14:00.
    nils2
    Junior Member
    • Apr 2011
    • 26

    Using the very hand utility called `mysql-schema-diff` I compared my upgraded MySQL schema with that of a freshly installed 6.05 server. I made the changes to make them identical, except for the row format (I left all tables as `dynamic`). Et voila, it started to work. I can Full Clone and customize my templates without issues. An interesting tidbit is that only some indices were dropped or created anew on the old schema. Apparently the 6-series installer is a bit sloppy in that regard - or maybe it's intentional so custom DB changes are left intact for the user.

    Special thanks to Markku for keeping up and offering some suggestions.

    Comment

    • vladimir_lv
      Senior Member
      • May 2022
      • 240

      #2
      Hi.
      Can you check the template version? Export template and find word "version ".

      Comment

      • nils2
        Junior Member
        • Apr 2011
        • 26

        #3
        Hi, see below:

        Code:
          version: '6.0'

        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1782

          #4
          Trying to establish a baseline first again to make sure I understand what was actually done So do you mean that you
          1. Upgraded Zabbix installation from 4.2 to 6.0.5
          2. Downloaded the "Linux by Zabbix agent" template from git.zabbix.com
          3. Imported it
          4. Attempted Full clone, and before doing anything else you got the error?

          Markku

          Comment

          • nils2
            Junior Member
            • Apr 2011
            • 26

            #5
            Yes. It gave the error when clicking "Add" after "Full Clone" and giving it a new name.

            Comment

            • Markku
              Senior Member
              Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
              • Sep 2018
              • 1782

              #6
              Right. I attempted the same (my Zabbix was just recently upgraded from 5.0.23 to 6.0.5 and doesn't have the Zabbix official templates):
              1. Downloaded the 6.0 template of "Linux by Zabbix agent" (template_os_linux.yaml)
              2. Imported it
              3. "Full clone", gave it a new name, "Add"
              4. Worked for me

              Your error message was referring to "/2/pages/1/widgets/3/fields/2/value", and there are some widgets under dashboards section in the original yaml file. In Zabbix GUI, if you try to modify them somehow, does it affect your "Full clone" attempt?

              Markku

              Comment

              • Markku
                Senior Member
                Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                • Sep 2018
                • 1782

                #7
                (Btw in that original yaml file the syntax is partly strange:

                Click image for larger version

Name:	yaml.png
Views:	541
Size:	3.9 KB
ID:	446020
                - why is the "y" field single-quoted and others aren't
                - why are integers quoted like strings

                I assume these are some known features of yaml that you can do whatever you like )

                Markku

                Comment

                • nils2
                  Junior Member
                  • Apr 2011
                  • 26

                  #8
                  The yaml indeed looks weird, but correct. It's a fairly lenient format.

                  I tried what you suggested, rearranged the graphs in the "System performance" dashboard and saved it as well, then saved the "Network interfaces" one (without changes as there are no discovered interfaces in a template). Still the same error:

                  Cannot add template
                  Invalid parameter "/2/pages/1/widgets/3/fields/1/value": a number is expected.

                  EDIT: in a freshly installed 6.05 instance cloning works as expected. No errors.

                  Comment

                  • Markku
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                    • Sep 2018
                    • 1782

                    #9
                    Originally posted by nils2
                    EDIT: in a freshly installed 6.05 instance cloning works as expected. No errors.
                    Interesting. How is your setup installed, which OS, packages installed and upgraded from official repo? Any special customizations "under the hood", like modified php files, manually edited database, or something like that?

                    After the 6.0.5 upgrade I did the double.sql modification as well as the history index additions. I haven't yet done the post-6.0 utf8mb4 change, the database is originally from some 3.x version (through maybe 3.4, 4.0, 4.4 and 5.0 series). Running on Debian 11 at the moment.

                    (Edit: Using MariaDB, currently the Debian-supplied 10.5.x. At some point I believe I had to do some row format change manually in the database.)

                    Markku

                    Comment

                    • nils2
                      Junior Member
                      • Apr 2011
                      • 26

                      #10
                      The setup is unmodified, I only have customized templates on the server itself. I always install the server from the upstream repo, never from the OS-provided packages. Debian 11, MariaDB 10.5, everything is upgraded to latest version. I only made 2 important changes: changed the table type of all tables to dynamic and ran the Zabbix provided (on the upgrade support page) utf8mb4 fix up script after the automatic schema upgrade. It was originally a 3.x setup, upgraded to 4.0, then 4.2 and now to 6.05. This is the first serious issue I've run into with Zabbix server upgrades...

                      Comment

                      • Markku
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                        • Sep 2018
                        • 1782

                        #11
                        Sounds pretty clean then.

                        How about totally deleting the Dashboards from the template (either from yaml before importing or from GUI before Full clone), does it affect the error message?

                        Markku

                        Comment

                        • nils2
                          Junior Member
                          • Apr 2011
                          • 26

                          #12
                          That's something I actually wanted to try, but I first need to devise a method to easily put them back. They seem useful so I don't want to just wipe them.

                          Comment

                          • Markku
                            Senior Member
                            Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                            • Sep 2018
                            • 1782

                            #13
                            One more (maybe not very handy) idea: if you can find the relevant part in the Zabbix sources, it may give a hint where the "invalid parameter" is.

                            I guess opening a support ticket is not useful (unless with paid support), it is highly likely that it will be closed as Cannot Reproduce... but maybe someone else suffers the same.

                            Markku

                            Comment

                            • Markku
                              Senior Member
                              Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                              • Sep 2018
                              • 1782

                              #14
                              And: "/2/pages/1/widgets/3/fields/1/value" I don't know that the 2 would be but it looks like "page 1, widget 3, field 1" has the invalid value

                              EDIT: Now I see that the error actually changed after you did some edits to the dashboards/widgets: the fields was 2 originally, later it was 1

                              Markku

                              Comment

                              • nils2
                                Junior Member
                                • Apr 2011
                                • 26

                                #15
                                Good catch. I tried to copy-paste the pages in the dashboards - this worked, I essentially re-created both dashes in the template and removed the old ones. Still the same error. It's nuts.

                                Comment

                                Working...