Ad Widget

Collapse

Upgrade Zabbix Server Database upgrade failed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rwelle
    Junior Member
    • Mar 2021
    • 8

    #1

    Upgrade Zabbix Server Database upgrade failed

    Hello,

    I want to upgrade my Zabbix Server version from 6.0.4 to 6.2, but after I start the Zabbix Server service the database upgrade process starts and it fails at 48% every time.
    I run a MySQL database version 8.0.29 and my linux version is Ubuntu 20.04.
    Anyone else experiencing the same issues or know why the upgrade is failing?
    The MySQL log file stays at 0kb

    Kr
  • adminjerry
    Junior Member
    • May 2022
    • 18

    #2
    Hi,

    I have been fighting this all morning also. From what I can tell, there is an issue with the grant all privileges on zabbix.* command. It doesn't update the record. So basically, zabbix has no permissions to update anything. There is also a mention about granting Super privilege in the log file but I'm not a programmer and I'm having trouble getting it work. I have actually just removed all packages and tried to load a fresh installation instead of update. I'm hoping that will work.

    Comment

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

      #3
      For what it's worth, my upgrade to 6.2.0 was successful on this setup:
      - Zabbix server 6.0.5
      - MariaDB 10.5.15 (from Debian 11)
      - the system was originally installed as Zabbix 5.0.x, then upgraded to 6.0.x
      - no primary keys had been added

      So no changes were needed for permissions on this combination.

      Markku

      Comment

      • Codyksp
        Junior Member
        • Jul 2022
        • 1

        #4
        I am experiencing the same issue after upgrading my Zabbix 6.0.4 install to version 6.2.1. I followed the instructions on https://www.zabbix.com/documentation.../debian_ubuntu substituting 20.04 for 22.04 as that is my server version.
        The database upgrade failed at 48% with no further details as to why the upgrade failed. Zabbix keeps trying to upgrade it now, but only shows "current database version (mandatory/optional): 06010048/06010048, starting automatic database upgrade, database upgrade failed" repeatedly.

        This is a test server with almost no configuration, so I have no issues installing a fresh 6.2.1 on a new VM. But considering this is version is now officially released I am surprised to see it can't upgrade the database from 6.0.4 in a fresh/empty install.

        Comment

        • Spoonman
          Member
          • Aug 2013
          • 45

          #5
          Same here : upgrade from Zabbix 6.06 to 6.2 fails......Database upgrade fails at 48%.
          (AlmaLinux 8.x and MySQL 8)

          Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #6
            Isn't it a problem exchanged at the following URL? If the problem is of the same cause, try setting log_bin_trust_function_creators.

            Comment

            • Rachelfoster
              Junior Member
              • Jul 2022
              • 11

              #7
              Having same issue. If I go into mysql, the zabbix DB is there and mysql -V says 10.6.

              I did replace my conf files with the new ones during the Zabbix upgrade. MyWawaVisit

              Comment

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

                #8
                Originally posted by Codyksp
                I am experiencing the same issue after upgrading my Zabbix 6.0.4 install to version 6.2.1. I followed the instructions on https://www.zabbix.com/documentation.../debian_ubuntu substituting 20.04 for 22.04 as that is my server version.
                The database upgrade failed at 48% with no further details as to why the upgrade failed. Zabbix keeps trying to upgrade it now, but only shows "current database version (mandatory/optional): 06010048/06010048, starting automatic database upgrade, database upgrade failed" repeatedly.

                This is a test server with almost no configuration, so I have no issues installing a fresh 6.2.1 on a new VM. But considering this is version is now officially released I am surprised to see it can't upgrade the database from 6.0.4 in a fresh/empty install.
                There is no Zabbix 6.2.1 released yet, the latest is still 6.2.0.

                Based on your database version you are/were currently running some kind of alpha/beta/rc version, not 6.0.4. Which may explain your particular problems.

                Markku

                Comment

                • rwelle
                  Junior Member
                  • Mar 2021
                  • 8

                  #9
                  Does anyone have an idea how I can further troubleshoot this issue?
                  I have the same issue as Cody:

                  The database upgrade failed at 48% with no further details as to why the upgrade failed.
                  Zabbix keeps trying to upgrade it now, but only shows "current database version (mandatory/optional): 06010048/06010048, starting automatic database upgrade, database upgrade failed" repeatedly.

                  Comment

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

                    #10
                    Does anyone have an idea how I can further troubleshoot this issue?
                    What is your
                    - current Zabbix version
                    - MySQL or MariaDB version

                    Do these help (as mentioned above as well)?

                    Unable to initialize mysql database in 6.2 per documentation

                    Unable to start after upgrade "The Zabbix DB version does not match requirements."

                    Markku

                    Comment

                    • rwelle
                      Junior Member
                      • Mar 2021
                      • 8

                      #11
                      Originally posted by Markku

                      What is your
                      - current Zabbix version
                      - MySQL or MariaDB version
                      I am running a MySQL server version8.0.29

                      Do these help (as mentioned above as well)?

                      Unable to initialize mysql database in 6.2 per documentation

                      Unable to start after upgrade "The Zabbix DB version does not match requirements."

                      Markku
                      Hi Markku

                      Our Zabbix is currently version 6.0.4
                      I am running a MySQL server version 8.0.29

                      I have read both threads, but the problems they describe are very much different then what I am experiencing.
                      The MySQL log stays empty and the zabbix server log only states it fails at 48% and then Zabbix keeps trying to upgrade it now, but only shows "current database version (mandatory/optional): 06010048/06010048, starting automatic database upgrade, database upgrade failed" repeatedly.

                      Comment

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

                        #12
                        Originally posted by rwelle
                        Our Zabbix is currently version 6.0.4
                        ...
                        current database version (mandatory/optional): 06010048/06010048
                        How do you explain that you say running 6.0.4 but the database version says you have something like 6.2.0alpha/beta/rc? What have you done earlier?

                        Example from a 6.0.6 installation:

                        Code:
                        MariaDB [zabbix]> select * from dbversion;
                        +-------------+-----------+----------+
                        | dbversionid | mandatory | optional |
                        +-------------+-----------+----------+
                        |           1 |   6000000 |  6000004 |
                        +-------------+-----------+----------+

                        Markku
                        Last edited by Markku; 11-07-2022, 09:55.

                        Comment

                        • rwelle
                          Junior Member
                          • Mar 2021
                          • 8

                          #13
                          Originally posted by Markku

                          How do you explain that you say running 6.0.4 but the database version says you have something like 6.2.0alpha/beta/rc? What have you done earlier?

                          Example from a 6.0.6 installation:

                          MariaDB [zabbix]> select * from dbversion;
                          +-------------+-----------+----------+
                          | dbversionid | mandatory | optional |
                          +-------------+-----------+----------+
                          | 1 | 6000000 | 6000004 |
                          +-------------+-----------+----------+



                          Markku
                          When I check for the zabbix server version i just run zabbix_server --version which states 6.0.4

                          mysql> select * from dbversion;
                          +-------------+-----------+----------+
                          | dbversionid | mandatory | optional |
                          +-------------+-----------+----------+
                          | 1 | 6010048 | 6010048 |
                          +-------------+-----------+----------+
                          1 row in set (0.00 sec)


                          I dont know I this is what my database says. Nothing special has been done after I have installed zabbix except setting up database partitioning.
                          But I have tried the update again. I am now seeing the same error with the SUPER privilages.

                          [Z3005] query failed: [1419] You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) [create trigger hosts_insert after insert on hosts
                          for each row
                          insert into changelog (object,objectid,operation,clock)
                          values (1,new.hostid,1,unix_timestamp())]
                          3655362:20220711:095422.522 database upgrade failed


                          I am just unsure what to do exactly.. can someone guide me?

                          The rights for the zabbix user:

                          mysql> SHOW GRANTS FOR zabbix@localhost;
                          +------------------------------------------------------------+
                          | Grants for zabbix@localhost |
                          +------------------------------------------------------------+
                          | GRANT USAGE ON *.* TO `zabbix`@`localhost` |
                          | GRANT ALL PRIVILEGES ON `zabbix`.* TO `zabbix`@`localhost` |
                          +------------------------------------------------------------+
                          2 rows in set (0.00 sec)
                          Last edited by rwelle; 11-07-2022, 09:59.

                          Comment

                          • rwelle
                            Junior Member
                            • Mar 2021
                            • 8

                            #14
                            I think I got it working now... I ran SET GLOBAL log_bin_trust_function_creators = 1; at the MySQL server

                            Comment

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

                              #15
                              Originally posted by rwelle
                              I think I got it working now... I ran SET GLOBAL log_bin_trust_function_creators = 1; at the MySQL server
                              Great, curious: what does your dbversion say now?

                              Markku

                              Comment

                              Working...