Ad Widget

Collapse

Database upgrade failed - 3.4 - 5.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbix_noob13
    Junior Member
    • Jul 2021
    • 3

    #1

    Database upgrade failed - 3.4 - 5.0

    I've just upgraded our zabbix server from Ubuntu 16 to 18 to 20, and upgraded Zabbix server from 3.4 to 5.0.

    The database upgrade got to 1% complete and then is now in a continue failed loop. It keeps getting stuck on the following:

    48948:20210729:072106.564 starting automatic database upgrade
    48948:20210729:072106.564 query [txnlev:1] [begin;]
    48948:20210729:072106.565 query [txnlev:1] [update events set name='Cannot calculate trigger expression.' where source=3 and object=0 and value=1]
    48948:20210729:072157.805 [Z3005] query failed: [1205] Lock wait timeout exceeded; try restarting transaction [update events set name='Cannot calculate trigger expression.' where source=3 and object=0 and value=1]
    48948:20210729:072157.805 slow query: 51.240353 sec, "update events set name='Cannot calculate trigger expression.' where source=3 and object=0 and value=1"
    48948:20210729:072157.805 In DBconnect() flag:0
    48948:20210729:072157.806 End of DBconnect():0
    48948:20210729:072157.806 ignoring query [txnlev:1] [update events set name='Cannot calculate trigger expression.' where source=3 and object=0 and value=1] within failed transaction
    48948:20210729:072157.806 query [txnlev:1] [rollback;]
    48948:20210729:072157.807 database upgrade failed
    48948:20210729:072157.807 End of DBcheck_version():FAIL


    Any assistance here would be greatly appreciated!
  • zabbix_noob13
    Junior Member
    • Jul 2021
    • 3

    #2
    Anyone??? I'm really struggling here. I've reverted the installation back a number of times and tried the upgrade again, however each time I'm faced with this same issue.

    Comment

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

      #3
      Maybe you have a database performance problem and you need to increase the lock timeout? (Just guessing) https://stackoverflow.com/questions/...even-though-im

      Markku

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        Originally posted by zabbix_noob13
        I've just upgraded our zabbix server from Ubuntu 16 to 18 to 20, and upgraded Zabbix server from 3.4 to 5.0.

        The database upgrade got to 1% complete and then is now in a continue failed loop. It keeps getting stuck on the following:

        48948:20210729:072106.564 starting automatic database upgrade
        48948:20210729:072106.564 query [txnlev:1] [begin;]
        48948:20210729:072106.565 query [txnlev:1] [update events set name='Cannot calculate trigger expression.' where source=3 and object=0 and value=1]
        48948:20210729:072157.805 [Z3005] query failed: [1205] Lock wait timeout exceeded; try restarting transaction [update events set name='Cannot calculate trigger expression.' where source=3 and object=0 and value=1]
        48948:20210729:072157.805 slow query: 51.240353 sec, "update events set name='Cannot calculate trigger expression.' where source=3 and object=0 and value=1"
        48948:20210729:072157.805 In DBconnect() flag:0
        48948:20210729:072157.806 End of DBconnect():0
        48948:20210729:072157.806 ignoring query [txnlev:1] [update events set name='Cannot calculate trigger expression.' where source=3 and object=0 and value=1] within failed transaction
        48948:20210729:072157.806 query [txnlev:1] [rollback;]
        48948:20210729:072157.807 database upgrade failed
        48948:20210729:072157.807 End of DBcheck_version():FAIL
        How many events are stored in your events table:

        Code:
        select count(*) from events;
        ?

        Also, is 3.4 the version of Zabbix you originally started with, or did you start with an older version and perhaps upgrade through some intermediate versions. I'm just trying to estimate how much database "cruft" your database schemas may have accumulated, or if they're still fairly pristine.

        Comment

        • zabbix_noob13
          Junior Member
          • Jul 2021
          • 3

          #5
          Thanks very much for replying tim.mooney.

          I'm guessing there is a lot of events! After around 20 minutes into the execution that query, i got an out of memory error and it wouldn't load. I'm not sure how much further to try, but I'm up to displaying 16 million rows, and there's still data in the table. Too big? If so, how would I purge some older records?

          I'm not sure whether our server was fresh installed or upgraded to 3.4. I wasn't around when would have occurred back late 2017. It certainly hasn't been upgraded since I started with the company in early 2018.

          Comment

          • tim.mooney
            Senior Member
            • Dec 2012
            • 1427

            #6
            I'm not really sure what to tell you. Zabbix is designed so that the database shouldn't grow without bounds; the 'housekeeper' process should be cleaning up records in various tables that have exceeded their appropriate retention time.

            I thought that included events, but looking at my own Zabbix install (still on 4.4.8), I see events going back more than 8 years, which is when we started with Zabbix (at 2.0.4). It seems like either it's not doing what it's supposed to or we both have problems with the housekeeper in our environments.

            Is "housekeeping" enabled for your install? Counterintuitively, "housekeeping" is documented by how you find it in the Administrative menu, rather than as a general overview of how the server works: https://www.zabbix.com/documentation...ration/general

            Comment

            Working...