Ad Widget

Collapse

Zabbix upgrade from 5.2 to to 5.4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbix_user84
    Junior Member
    • Jan 2021
    • 25

    #1

    Zabbix upgrade from 5.2 to to 5.4

    Hi all.
    When I try to update my Zabbix from version 5.2 to version 5.4 (Installed on Ubuntu Server 18.04) I get an error message at the end, when I try to access via HTTP.

    There is also an error which appears in the logs of zabbix_server.log:

    sudo tail -f /var/log/zabbix/zabbix_server.log
    3526:20210520:073615.216 IPv6 support: YES
    3526:20210520:073615.216 TLS support: YES
    3526:20210520:073615.216 ******************************
    3526:20210520:073615.216 using configuration file: /etc/zabbix/zabbix_server.conf
    3526:20210520:073615.223 Unsupported DB! MariaDB version is 50505 which is smaller than minimum of 100037
    3526:20210520:073615.224 current database version (mandatory/optional): 05030069/05030069
    3526:20210520:073615.224 required mandatory version: 05040000
    3526:20210520:073615.224 starting automatic database upgrade
    3526:20210520:073615.224 [Z3005] query failed: [1832] Cannot change column 'scriptid': used in a foreign key constraint 'c_opcommand_2' [alter table opcommand modify `scriptid` bigint unsigned not null]
    3526:20210520:073615.224 database upgrade failed
    Attached Files
    Last edited by zabbix_user84; 20-05-2021, 17:56.
  • zabbix_user84
    Junior Member
    • Jan 2021
    • 25

    #2
    Moreover, to the following question:

    Configuration file '/etc/zabbix/zabbix_server.conf'
    ==> Modified (by you or by a script) since installation.
    ==> Package distributor has shipped an updated version.
    What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
    D : show the differences between the versions
    Z : start a shell to examine the situation
    The default action is to keep your current version.
    *** zabbix_server.conf (Y/I/N/O/D/Z) [default=N] ?


    I answer yes, then I edit the file in order to reset the correct MySQL password again, which is deleted during the update of the file.
    Is this the right procedure?
    Thank you for everything.

    Comment

    • zabbix_user84
      Junior Member
      • Jan 2021
      • 25

      #3
      Thank you for your answer
      I've made an "gpupdate" then a "gpupgrade" of my my server based on Ubuntu 18.04. After trying to make a new upgrade of my Zabbix, I've got this in my zabbix_server.log:

      85061:20210521:075827.860 completed 28% of database upgrade
      85061:20210521:075827.963 completed 29% of database upgrade
      85061:20210521:075828.343 completed 30% of database upgrade
      85061:20210521:075828.848 completed 31% of database upgrade
      85061:20210521:075829.185 completed 32% of database upgrade
      85061:20210521:075829.555 completed 33% of database upgrade
      85061:20210521:075829.624 completed 34% of database upgrade
      85061:20210521:075829.635 completed 35% of database upgrade
      85061:20210521:075829.635 [Z3005] query failed: [1832] Cannot change column 'scriptid': used in a foreign key constraint 'c_opcommand_2' [alter table opcommand modify `scriptid` bigint unsigned not null]
      85061:20210521:075829.635 database upgrade failed

      Comment

      • zabbix_user84
        Junior Member
        • Jan 2021
        • 25

        #4
        I'm trying to upgrade my Ubuntu version from 18.04 to 20.04 to see if It's going to solve the problem

        Comment

        • sergioli
          Junior Member
          • May 2021
          • 1

          #5
          Hi guys,

          I experience exactly the same issue during update. If i do it from 5.0.10 to 5.4, or 5.2 to 5.4.

          Ubuntu 18.04.5 LTS
          mysql Ver 15.1 Distrib 10.1.48-MariaDB

          1532:20210521:120904.526 using configuration file: /etc/zabbix/zabbix_server.conf
          1532:20210521:120904.536 Unsupported DB! MariaDB version is 50505 which is smaller than minimum of 100037
          1532:20210521:120904.538 current database version (mandatory/optional): 05030069/05030069
          1532:20210521:120904.538 required mandatory version: 05040000
          1532:20210521:120904.538 starting automatic database upgrade
          1532:20210521:120904.538 [Z3005] query failed: [1832] Cannot change column 'scriptid': used in a foreign key constraint 'c_opcommand_2' [alter table opcommand modify `scriptid` bigint unsigned not null]
          1532:20210521:120904.538 database upgrade failed

          zabbix_user84
          tell me if you have any news or fix.

          Regards
          Sergio

          Comment

          • cybermcm
            Junior Member
            • Jan 2019
            • 13

            #6
            same here, using Zabbix for my home lab with a Raspi OS docker installation (zabbix and MariaDB with docker containers)
            MariaDB ver 10.1.48
            upgrade fails :-(
            Code:
            zabbix-server | 7:20210521:162008.282 Starting Zabbix Server. Zabbix 5.4.0 (revision 5059e20).
            zabbix-server | 7:20210521:162008.282 ****** Enabled features ******
            zabbix-server | 7:20210521:162008.282 SNMP monitoring: YES
            zabbix-server | 7:20210521:162008.282 IPMI monitoring: YES
            zabbix-server | 7:20210521:162008.282 Web monitoring: YES
            zabbix-server | 7:20210521:162008.282 VMware monitoring: YES
            zabbix-server | 7:20210521:162008.282 SMTP authentication: YES
            zabbix-server | 7:20210521:162008.282 ODBC: YES
            zabbix-server | 7:20210521:162008.282 SSH support: YES
            zabbix-server | 7:20210521:162008.282 IPv6 support: YES
            zabbix-server | 7:20210521:162008.282 TLS support: YES
            zabbix-server | 7:20210521:162008.282 ******************************
            zabbix-server | 7:20210521:162008.283 using configuration file: /etc/zabbix/zabbix_server.conf
            zabbix-server | 7:20210521:162008.297 current database version (mandatory/optional): 05030069/05030069
            zabbix-server | 7:20210521:162008.297 required mandatory version: 05040000
            zabbix-server | 7:20210521:162008.297 starting automatic database upgrade
            zabbix-server | 7:20210521:162008.299 [Z3005] query failed: [1832] Cannot change column 'scriptid': used in a foreign key constraint 'c_opcommand_2' [alter table opcommand modify `scriptid` bigint unsigned not null]
            zabbix-server | 7:20210521:162008.300 database upgrade failed

            fresh installation works

            still no solution for an upgrade

            Comment

            • cybermcm
              Junior Member
              • Jan 2019
              • 13

              #7
              maybe a possible solution here: https://www.zabbix.com/forum/zabbix-...174#post425174
              It still has to be confirmed that it is safe to edit the database this way

              Comment

              • jolalla
                Member
                • May 2021
                • 45

                #8
                Hi everyone, i'm new to zabbix. but they gave me the responsibility of updating and updating the platform. I dieorn the version in 3.4 but I managed to update it to version 5.0.9
                Currently I have:
                Zabbix 5.0.9 running on Centos7
                PostgreSQL database 9.6.9.

                I must say that I am not an expert in Linux and I know less about Postgres. Little by little I have been learning by watching and reading these forums.
                My question is the following:
                When I started working on this platform they told me that I could erase everything there was and start from scratch. So I did. Delete all Hosts and start from scratch. Previously there were approximately 80 Hosts between windows servers, linux and switches. After eliminating all of them I have been adding little by little, currently there are only 13 hosts and all in Windows.
                But the Postgresql DB is super big, its size is 638GB.
                If I delete all the Hosts and now there are very few left, shouldn't that DB size decrease? or how do I reduce the size of that database?

                Thank you

                Comment


                • derli1988
                  derli1988 commented
                  Editing a comment
                  Hey Jolalla... You probably have a big history.

                  If you go to your postgreSQL and check the tables size of your Zabbix Database, what do you see?
              • dimir
                Zabbix developer
                • Apr 2011
                • 1080

                #9
                You're welcome to follow issue https://support.zabbix.com/browse/ZBX-19400

                Comment

              • dimir
                Zabbix developer
                • Apr 2011
                • 1080

                #10
                Yeah, I saw that. After having a discussion with the team they agreed. Thanks!

                Comment

                • jolalla
                  Member
                  • May 2021
                  • 45

                  #11
                  hello derli1988 thanks for reply.


                  the truth if I have a great story, hehe

                  I am not an expert in linux and less in zabbix or postgres.

                  All the little that I have done is reading in google and now I registered in this forum to be able to ask for better help.
                  Well they changed the instructions. Install a new zabbix server. In centos 7 with zabbix 5.0.12 and mysql Version 15.1 Distrib 10.4.19-MariaDB.
                  Centos install it with a 400 GB disk and the disk distribution is like image 001 atach here.
                  My question is the following, how to know if the mysql DB will save the data in the partition with the most available space, which is the 345GB?
                  I ask it so that when the DB grows it does so in that partition that has more space available.

                  Thank you very much for answering and for your help Derli. An sorry for my bad. And I'm sorry for my bad English, but I'm from Chile and I don't write English very well.
                  Attached Files

                  Comment

                  • filipi_saci
                    Junior Member
                    • Apr 2021
                    • 5

                    #12
                    HTML Code:
                    systemctl stop zabbix_server.service
                    mysql -u root
                    show columns from zabbix.opcommand;
                    ALTER TABLE zabbix.opcommand DROP FOREIGN KEY c_opcommand_2;
                    systemctl start zabbix_server.service
                    tail -f /var/log/zabbix/zabbix_server.log

                    Referece: https://serveradmin.ru/obnovlenie-zabbix-5-2-do-5-4/

                    Comment

                    • torture_killer
                      Junior Member
                      • Nov 2021
                      • 1

                      #13
                      Hi all,
                      I'm new to the community here and zabbix at all, and had a deep dive yesterday.
                      I performed:
                      - Create Backup of the hole machine
                      - Stop Zabbix server and agent service
                      - Update OS (Ubuntu) to the latest version
                      - Upgrade MariaDB to the latest version
                      - Update Zabbix Server to the latest version
                      - Start Zabbix server and agent service

                      And got this error in the log:
                      [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)

                      Do some research on the problem, but do not fix it. Then i restored the machine in the state before updates, and error is still the same.
                      Thank You in advance!

                      Comment

                      • cyber
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Dec 2006
                        • 4807

                        #14
                        probably should fix DB connection issue. It quite clearly states, that it cannot connect. Maybe some config files were overwritten during upgrade? Or something happened to DB...

                        Comment

                        • cyber
                          Senior Member
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Dec 2006
                          • 4807

                          #15
                          Unsupported DB! MariaDB version is 50505 which is smaller than minimum of 100037 ... start with meeting requirements (probably need to upgrade your platform also)... then continue.
                          second question... of course, if you answer yes and install package version, it will overwrite everything you have changed there...
                          So check differences (make notes) and continue with "keep your version". If there are completely new options you need to introduce those manually later (based on notes you made).

                          Comment

                          Working...