Ad Widget

Collapse

database upgrade failed from 3.2 to 3.4 failed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xvyhli02
    Junior Member
    • May 2017
    • 2

    #1

    database upgrade failed from 3.2 to 3.4 failed

    Dear friends, please could you somebody help me with this trouble?

    upgrade proccess is stucking at dropping table 'dservices_1' which does not exist.

    Thank you for your tips.

    6111:20170822:162806.983 Starting Zabbix Server. Zabbix 3.4.0 (revision 71467).
    6111:20170822:162806.983 ****** Enabled features ******
    6111:20170822:162806.983 SNMP monitoring: YES
    6111:20170822:162806.983 IPMI monitoring: YES
    6111:20170822:162806.983 Web monitoring: YES
    6111:20170822:162806.984 VMware monitoring: YES
    6111:20170822:162806.984 SMTP authentication: YES
    6111:20170822:162806.984 Jabber notifications: YES
    6111:20170822:162806.984 Ez Texting notifications: YES
    6111:20170822:162806.984 ODBC: NO
    6111:20170822:162806.984 SSH2 support: YES
    6111:20170822:162806.984 IPv6 support: YES
    6111:20170822:162806.984 TLS support: YES
    6111:20170822:162806.984 ******************************
    6111:20170822:162806.984 using configuration file: /usr/local/etc/zabbix_server.conf
    6111:20170822:162806.986 current database version (mandatory/optional): 03030005/03030005
    6111:20170822:162806.987 required mandatory version: 03040000
    6111:20170822:162806.987 starting automatic database upgrade
    6111:20170822:162806.987 [Z3005] query failed: [1091] Can't DROP 'dservices_1'; check that column/key exists [drop index dservices_1 on dservices]
    6111:20170822:162806.987 database upgrade failed
  • scimitar
    Junior Member
    • Aug 2017
    • 3

    #2
    Z3005] query failed: [1022] Can't write; duplicate key in table '#sql-4a3_13'

    We have a little the same problem:


    1400:20170823:150149.086 using configuration file: /etc/zabbix/zabbix_server.conf
    1400:20170823:150149.088 current database version (mandatory/optional): 03030185/03030185
    1400:20170823:150149.088 required mandatory version: 03040000
    1400:20170823:150149.088 starting automatic database upgrade
    1400:20170823:150149.135 [Z3005] query failed: [1022] Can't write; duplicate key in table '#sql-4a3_13' [alter table items add constraint c_items_5 foreign key (master_itemid) references items (itemid) on delete cascade]
    1400:20170823:150149.136 database upgrade failed
    1431:20170823:150159.336 Starting Zabbix Server. Zabbix 3.4.0 (revision 71467).
    1431:20170823:150159.336 ****** Enabled features ******
    1431:20170823:150159.336 SNMP monitoring: YES
    1431:20170823:150159.336 IPMI monitoring: YES
    1431:20170823:150159.336 Web monitoring: YES
    1431:20170823:150159.336 VMware monitoring: YES
    1431:20170823:150159.336 SMTP authentication: YES
    1431:20170823:150159.336 Jabber notifications: YES
    1431:20170823:150159.336 Ez Texting notifications: YES
    1431:20170823:150159.336 ODBC: YES
    1431:20170823:150159.336 SSH2 support: YES
    1431:20170823:150159.336 IPv6 support: YES
    1431:20170823:150159.336 TLS support: YES
    1431:20170823:150159.336 ******************************

    Comment

    • scimitar
      Junior Member
      • Aug 2017
      • 3

      #3
      Hello,

      Does anyone have an idea how we get this back to running? Our monitoring system is down.

      Comment

      • sccuser
        Member
        • May 2013
        • 77

        #4
        I got the same situation after upgrading to 3.4.0

        Code:
         10104:20170825:010210.557 Starting Zabbix Server. Zabbix 3.4.0 (revision 71467).
         10104:20170825:010210.582 ****** Enabled features ******
         10104:20170825:010210.582 SNMP monitoring:           YES
         10104:20170825:010210.582 IPMI monitoring:           YES
         10104:20170825:010210.582 Web monitoring:            YES
         10104:20170825:010210.582 VMware monitoring:         YES
         10104:20170825:010210.582 SMTP authentication:        NO
         10104:20170825:010210.582 Jabber notifications:       NO
         10104:20170825:010210.582 Ez Texting notifications:  YES
         10104:20170825:010210.582 ODBC:                       NO
         10104:20170825:010210.582 SSH2 support:               NO
         10104:20170825:010210.582 IPv6 support:              YES
         10104:20170825:010210.582 TLS support:                NO
         10104:20170825:010210.582 ******************************
         10104:20170825:010210.582 using configuration file: /usr/local/etc/zabbix_server.conf
         10104:20170825:010210.642 current database version (mandatory/optional): 03030013/03030013
         10104:20170825:010210.643 required mandatory version: 03040000
         10104:20170825:010210.643 starting automatic database upgrade
         10104:20170825:010210.668 [Z3005] query failed: [1050] Table 'item_preproc' already exists [create table item_preproc (
        item_preprocid bigint unsigned not null,
        itemid bigint unsigned not null,
        step integer default '0' not null,
        type integer default '0' not null,
        params varchar(255) default '' not null,
        primary key (item_preprocid)
        ) engine=innodb]
         10104:20170825:010210.668 database upgrade failed

        Comment

        • glebs.ivanovskis
          Senior Member
          • Jul 2015
          • 237

          #5
          Looks very much like ZBX-11203. Could you describe your upgrade procedure? It may be a good idea to launch Zabbix server manually for the first time after upgrade.

          As a workaround you can make sure that failing step was actually executed already and increase dbversion by one.

          Comment

          • sccuser
            Member
            • May 2013
            • 77

            #6
            Upgrading Zabbix to latest version was not my target, this was because of I unintentionally removed zabbix directories (php, configuration...) yesterday.

            In order get my service back as quick, I was doing:
            - remove all rest remaining of zabbix stuff
            - download zabbix 3.4.0 from sourceforge.net
            - recompile again
            - re-configuration zabbix stuff (server, agent, proxy...)
            - re-configuration php setting to point to current DB (MariaDB latest)
            - and got error as described

            Spent couple hours to troubleshoot, I end-up with workaround steps as doing drop several of existent tables and restart zabbix-server

            Code:
            $ mysql -u<user> -p<password> zabbix -e "drop table item_preproc;"
            $ mysql -u<user> -p<password> zabbix -e "drop table task_remote_command;"
            $ mysql -u<user> -p<password> zabbix -e "drop table task_remote_command_result;"
            $ mysql -u<user> -p<password> zabbix -e "drop table sysmap_shape;"
            $ mysql -u<user> -p<password> zabbix -e "drop table sysmap_element_trigger;"
            $ mysql -u<user> -p<password> zabbix -e "drop table httptest_field;"
            $ mysql -u<user> -p<password> zabbix -e "drop table httpstep_field;"
            $ mysql -u<user> -p<password> zabbix -e "SET FOREIGN_KEY_CHECKS=0; drop table dashboard; SET FOREIGN_KEY_CHECKS=1;"
            $ mysql -u<user> -p<password> zabbix -e "drop table dashboard_user;"
            $ mysql -u<user> -p<password> zabbix -e "drop table dashboard_usrgrp;"
            $ mysql -u<user> -p<password> zabbix -e "SET FOREIGN_KEY_CHECKS=0; drop table widget; SET FOREIGN_KEY_CHECKS=1;"
            $ mysql -u<user> -p<password> zabbix -e "drop table widget_field;"
            $ mysql -u<user> -p<password> zabbix -e "drop table task_acknowledge;"
            Hope it helps to others

            Comment

            • xvyhli02
              Junior Member
              • May 2017
              • 2

              #7
              Originally posted by xvyhli02
              Dear friends, please could you somebody help me with this trouble?

              upgrade proccess is stucking at dropping table 'dservices_1' which does not exist.

              Thank you for your tips.

              6111:20170822:162806.983 Starting Zabbix Server. Zabbix 3.4.0 (revision 71467).
              6111:20170822:162806.983 ****** Enabled features ******
              6111:20170822:162806.983 SNMP monitoring: YES
              6111:20170822:162806.983 IPMI monitoring: YES
              6111:20170822:162806.983 Web monitoring: YES
              6111:20170822:162806.984 VMware monitoring: YES
              6111:20170822:162806.984 SMTP authentication: YES
              6111:20170822:162806.984 Jabber notifications: YES
              6111:20170822:162806.984 Ez Texting notifications: YES
              6111:20170822:162806.984 ODBC: NO
              6111:20170822:162806.984 SSH2 support: YES
              6111:20170822:162806.984 IPv6 support: YES
              6111:20170822:162806.984 TLS support: YES
              6111:20170822:162806.984 ******************************
              6111:20170822:162806.984 using configuration file: /usr/local/etc/zabbix_server.conf
              6111:20170822:162806.986 current database version (mandatory/optional): 03030005/03030005
              6111:20170822:162806.987 required mandatory version: 03040000
              6111:20170822:162806.987 starting automatic database upgrade
              6111:20170822:162806.987 [Z3005] query failed: [1091] Can't DROP 'dservices_1'; check that column/key exists [drop index dservices_1 on dservices]
              6111:20170822:162806.987 database upgrade failed
              For completeness:
              here are steps, which i have taken.

              1- stopped server
              2 - compiled new binaries from sources
              3 - installed new binaries
              4 - started new server and watched server.log in the second terminal window...

              Happily, my server is at VMware and I have done snapshot before all actions, so I could do step back.

              Comment

              • xanadu
                Member
                • Sep 2014
                • 62

                #8
                Originally posted by scimitar
                We have a little the same problem:


                1400:20170823:150149.086 using configuration file: /etc/zabbix/zabbix_server.conf
                1400:20170823:150149.088 current database version (mandatory/optional): 03030185/03030185
                1400:20170823:150149.088 required mandatory version: 03040000
                1400:20170823:150149.088 starting automatic database upgrade
                1400:20170823:150149.135 [Z3005] query failed: [1022] Can't write; duplicate key in table '#sql-4a3_13' [alter table items add constraint c_items_5 foreign key (master_itemid) references items (itemid) on delete cascade]
                1400:20170823:150149.136 database upgrade failed
                1431:20170823:150159.336 Starting Zabbix Server. Zabbix 3.4.0 (revision 71467).
                1431:20170823:150159.336 ****** Enabled features ******
                1431:20170823:150159.336 SNMP monitoring: YES
                1431:20170823:150159.336 IPMI monitoring: YES
                1431:20170823:150159.336 Web monitoring: YES
                1431:20170823:150159.336 VMware monitoring: YES
                1431:20170823:150159.336 SMTP authentication: YES
                1431:20170823:150159.336 Jabber notifications: YES
                1431:20170823:150159.336 Ez Texting notifications: YES
                1431:20170823:150159.336 ODBC: YES
                1431:20170823:150159.336 SSH2 support: YES
                1431:20170823:150159.336 IPv6 support: YES
                1431:20170823:150159.336 TLS support: YES
                1431:20170823:150159.336 ******************************
                did you manage to resolve your issue? I'm having the same error message.

                Comment

                • MartyZellerbach
                  Junior Member
                  • Dec 2015
                  • 14

                  #9
                  Move database dump 3.2.x to 3.4.x

                  Create database zabbix34 OK

                  Code:
                  [root@lnx-350000-021 mysql]# mysql -uzab -p zabbix34 < schema.sql
                  [root@lnx-350000-021 mysql]# mysql -uzab -p zabbix34 < images.sql
                  [root@lnx-350000-021 mysql]# mysql -uzab -p zabbix34 < data.sql
                  OK

                  Load database version zabbix backup 3.2.x
                  Code:
                  mysql -uzab -p zabbix34 < zabbix3_20170830_2300.dump.sql
                  ERROR 1005 (HY000) at line 810: Can't create table `zabbix34`.`dashboard` (errno: 150 "Foreign key constraint is incorre ctly formed")

                  Please help.

                  Comment

                  • MartyZellerbach
                    Junior Member
                    • Dec 2015
                    • 14

                    #10
                    Originally posted by sccuser
                    Upgrading Zabbix to latest version was not my target, this was because of I unintentionally removed zabbix directories (php, configuration...) yesterday.

                    In order get my service back as quick, I was doing:
                    - remove all rest remaining of zabbix stuff
                    - download zabbix 3.4.0 from sourceforge.net
                    - recompile again
                    - re-configuration zabbix stuff (server, agent, proxy...)
                    - re-configuration php setting to point to current DB (MariaDB latest)
                    - and got error as described

                    Spent couple hours to troubleshoot, I end-up with workaround steps as doing drop several of existent tables and restart zabbix-server

                    Code:
                    $ mysql -u<user> -p<password> zabbix -e "drop table item_preproc;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table task_remote_command;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table task_remote_command_result;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table sysmap_shape;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table sysmap_element_trigger;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table httptest_field;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table httpstep_field;"
                    $ mysql -u<user> -p<password> zabbix -e "SET FOREIGN_KEY_CHECKS=0; drop table dashboard; SET FOREIGN_KEY_CHECKS=1;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table dashboard_user;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table dashboard_usrgrp;"
                    $ mysql -u<user> -p<password> zabbix -e "SET FOREIGN_KEY_CHECKS=0; drop table widget; SET FOREIGN_KEY_CHECKS=1;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table widget_field;"
                    $ mysql -u<user> -p<password> zabbix -e "drop table task_acknowledge;"
                    Hope it helps to others
                    Ok this is a temporary solution but it works. Thanks.

                    Comment

                    • Atsushi
                      Senior Member
                      • Aug 2013
                      • 2028

                      #11
                      When upgrading from 3.2 to 3.4 it is incorrect to create a database for 3.4 with data and load 3.2 dump into that database.

                      Please define only an empty database and load the 3.2 dump into the empty database.
                      After that, upgrading is done automatically by starting zabbix_server.

                      ex.
                      Code:
                      # mysql -uroot -p
                      mysql> create database zabbix34 character set utf8 collate utf8_bin;
                      mysql> grant all privileges on zabbix34.* to zabbix@localhost identified by 'password';
                      mysql> exit
                      # mysql -uzabbix -p zabbix34 < zabbix3_20170830_2300.dump.sql
                      # systemctl start zabbix-server

                      Comment

                      • MartyZellerbach
                        Junior Member
                        • Dec 2015
                        • 14

                        #12
                        Originally posted by Atsushi
                        When upgrading from 3.2 to 3.4 it is incorrect to create a database for 3.4 with data and load 3.2 dump into that database.

                        Please define only an empty database and load the 3.2 dump into the empty database.
                        After that, upgrading is done automatically by starting zabbix_server.

                        ex.
                        Code:
                        # mysql -uroot -p
                        mysql> create database zabbix34 character set utf8 collate utf8_bin;
                        mysql> grant all privileges on zabbix34.* to zabbix@localhost identified by 'password';
                        mysql> exit
                        # mysql -uzabbix -p zabbix34 < zabbix3_20170830_2300.dump.sql
                        # systemctl start zabbix-server
                        log file:

                        Code:
                        39860:20170902:091720.876 Starting Zabbix Server. Zabbix 3.4.1 (revision 71734).
                         39860:20170902:091720.876 ****** Enabled features ******
                         39860:20170902:091720.876 SNMP monitoring:           YES
                         39860:20170902:091720.876 IPMI monitoring:           YES
                         39860:20170902:091720.876 Web monitoring:            YES
                         39860:20170902:091720.876 VMware monitoring:         YES
                         39860:20170902:091720.876 SMTP authentication:       YES
                         39860:20170902:091720.876 Jabber notifications:      YES
                         39860:20170902:091720.876 Ez Texting notifications:  YES
                         39860:20170902:091720.876 ODBC:                      YES
                         39860:20170902:091720.876 SSH2 support:              YES
                         39860:20170902:091720.876 IPv6 support:               NO
                         39860:20170902:091720.876 TLS support:                NO
                         39860:20170902:091720.876 ******************************
                         39860:20170902:091720.876 using configuration file: /etc/zabbix/zabbix_server.conf
                         39860:20170902:091720.956 current database version (mandatory/optional): 03020000/03020000
                         39860:20170902:091720.956 required mandatory version: 03040000
                         39860:20170902:091720.956 starting automatic database upgrade
                         39860:20170902:091721.024 completed 0% of database upgrade
                         39860:20170902:091727.531 slow query: 6.506101 sec, "alter table items modify snmp_oid varchar(512) default '' not null"
                         39860:20170902:091727.567 completed 1% of database upgrade
                         39860:20170902:091728.963 completed 2% of database upgrade
                         39860:20170902:091729.623 completed 3% of database upgrade
                         39860:20170902:091729.841 completed 4% of database upgrade
                         39860:20170902:091730.982 completed 5% of database upgrade
                         39860:20170902:091732.552 completed 6% of database upgrade
                         39860:20170902:091734.721 completed 7% of database upgrade
                         39860:20170902:091735.476 completed 8% of database upgrade
                         39860:20170902:091736.560 completed 9% of database upgrade
                         39860:20170902:091742.667 slow query: 6.106615 sec, "alter table items drop column multiplier"
                         39860:20170902:091747.539 slow query: 4.824886 sec, "alter table items drop column data_type"
                         39860:20170902:091747.583 completed 10% of database upgrade
                         39860:20170902:091751.047 slow query: 3.463185 sec, "alter table items drop column delta"
                         39860:20170902:091751.538 completed 11% of database upgrade
                         39860:20170902:091751.712 completed 12% of database upgrade
                         39860:20170902:091751.808 completed 13% of database upgrade
                         39860:20170902:091754.528 completed 14% of database upgrade
                         39860:20170902:091830.164 completed 15% of database upgrade
                         39860:20170902:091831.207 completed 16% of database upgrade
                         39860:20170902:091832.332 completed 17% of database upgrade
                         39860:20170902:091833.573 completed 18% of database upgrade
                         39860:20170902:091834.849 completed 19% of database upgrade
                         39860:20170902:091836.077 completed 20% of database upgrade
                         39860:20170902:091836.161 completed 21% of database upgrade
                         39860:20170902:091836.688 completed 22% of database upgrade
                         39860:20170902:091837.509 completed 23% of database upgrade
                         39860:20170902:091841.463 slow query: 3.953568 sec, "alter table triggers modify error varchar(2048) default '' not null"
                         39860:20170902:091843.124 completed 24% of database upgrade
                         39860:20170902:091843.704 completed 25% of database upgrade
                         39860:20170902:091845.574 completed 26% of database upgrade
                         39860:20170902:091846.137 completed 27% of database upgrade
                         39860:20170902:091847.242 completed 28% of database upgrade
                         39860:20170902:091847.785 completed 29% of database upgrade
                         39860:20170902:091848.653 completed 30% of database upgrade
                         39860:20170902:091849.577 completed 31% of database upgrade
                         39860:20170902:091850.411 completed 32% of database upgrade
                         39860:20170902:091851.128 completed 33% of database upgrade
                         39860:20170902:091852.531 completed 34% of database upgrade
                         39860:20170902:091852.674 completed 35% of database upgrade
                         39860:20170902:091852.751 completed 36% of database upgrade
                         39860:20170902:091852.847 completed 37% of database upgrade
                         39860:20170902:091854.010 completed 38% of database upgrade
                         39860:20170902:091854.968 completed 39% of database upgrade
                         39860:20170902:091855.963 completed 40% of database upgrade
                         39860:20170902:091856.981 completed 41% of database upgrade
                         39860:20170902:091858.107 completed 42% of database upgrade
                         39860:20170902:091859.180 completed 43% of database upgrade
                         39860:20170902:091859.276 completed 44% of database upgrade
                         39860:20170902:091900.276 completed 45% of database upgrade
                         39860:20170902:091904.840 slow query: 4.513602 sec, "alter table items modify delay varchar(1024) default '0' not null"
                         39860:20170902:091904.962 completed 46% of database upgrade
                         39860:20170902:091909.763 slow query: 3.261788 sec, "alter table items drop column delay_flex"
                         39860:20170902:091909.802 completed 47% of database upgrade
                         39860:20170902:091914.452 slow query: 4.649540 sec, "alter table items modify history varchar(255) default '90d' not null"
                         39860:20170902:091914.560 completed 48% of database upgrade
                         39860:20170902:091919.245 slow query: 4.684135 sec, "alter table items modify trends varchar(255) default '365d' not null"
                         39860:20170902:091919.329 completed 49% of database upgrade
                         39860:20170902:091925.727 slow query: 4.564571 sec, "alter table items modify lifetime varchar(255) default '30d' not null"
                         39860:20170902:091925.763 completed 50% of database upgrade
                         39860:20170902:091927.380 completed 51% of database upgrade
                         39860:20170902:091928.478 completed 52% of database upgrade
                         39860:20170902:091929.496 completed 53% of database upgrade
                         39860:20170902:091930.473 completed 54% of database upgrade
                         39860:20170902:091931.485 completed 55% of database upgrade
                         39860:20170902:091932.431 completed 56% of database upgrade
                         39860:20170902:091933.384 completed 57% of database upgrade
                         39860:20170902:091934.319 completed 58% of database upgrade
                         39860:20170902:091935.241 completed 59% of database upgrade
                         39860:20170902:091936.171 completed 60% of database upgrade
                         39860:20170902:091937.112 completed 61% of database upgrade
                         39860:20170902:091938.070 completed 62% of database upgrade
                         39860:20170902:091938.968 completed 63% of database upgrade
                         39860:20170902:091939.969 completed 64% of database upgrade
                         39860:20170902:091940.939 completed 65% of database upgrade
                         39860:20170902:091941.946 completed 66% of database upgrade
                         39860:20170902:091942.814 completed 67% of database upgrade
                         39860:20170902:091942.935 completed 68% of database upgrade
                         39860:20170902:091943.096 completed 69% of database upgrade
                         39860:20170902:091943.199 completed 70% of database upgrade
                         39860:20170902:091947.117 slow query: 3.917290 sec, "alter table items add jmx_endpoint varchar(255) default '' not null"
                         39860:20170902:091947.541 completed 71% of database upgrade
                         39860:20170902:091948.602 completed 72% of database upgrade
                         39860:20170902:091949.298 completed 73% of database upgrade
                         39860:20170902:091949.598 [Z3005] query failed: [1050] Table 'dashboard' already exists [create table dashboard (
                        dashboardid bigint unsigned not null,
                        name varchar(255) not null,
                        userid bigint unsigned not null,
                        private integer default '1' not null,
                        primary key (dashboardid)
                        ) engine=innodb]
                         39860:20170902:091949.598 database upgrade failed

                        Comment

                        • MartyZellerbach
                          Junior Member
                          • Dec 2015
                          • 14

                          #13
                          Originally posted by MartyZellerbach
                          log file:

                          Code:
                          39860:20170902:091720.876 Starting Zabbix Server. Zabbix 3.4.1 (revision 71734).
                           39860:20170902:091720.876 ****** Enabled features ******
                           39860:20170902:091720.876 SNMP monitoring:           YES
                           39860:20170902:091720.876 IPMI monitoring:           YES
                           39860:20170902:091720.876 Web monitoring:            YES
                           39860:20170902:091720.876 VMware monitoring:         YES
                           39860:20170902:091720.876 SMTP authentication:       YES
                           39860:20170902:091720.876 Jabber notifications:      YES
                           39860:20170902:091720.876 Ez Texting notifications:  YES
                           39860:20170902:091720.876 ODBC:                      YES
                           39860:20170902:091720.876 SSH2 support:              YES
                           39860:20170902:091720.876 IPv6 support:               NO
                           39860:20170902:091720.876 TLS support:                NO
                           39860:20170902:091720.876 ******************************
                           39860:20170902:091720.876 using configuration file: /etc/zabbix/zabbix_server.conf
                           39860:20170902:091720.956 current database version (mandatory/optional): 03020000/03020000
                           39860:20170902:091720.956 required mandatory version: 03040000
                           39860:20170902:091720.956 starting automatic database upgrade
                           39860:20170902:091721.024 completed 0% of database upgrade
                           39860:20170902:091727.531 slow query: 6.506101 sec, "alter table items modify snmp_oid varchar(512) default '' not null"
                           39860:20170902:091727.567 completed 1% of database upgrade
                           39860:20170902:091728.963 completed 2% of database upgrade
                           39860:20170902:091729.623 completed 3% of database upgrade
                           39860:20170902:091729.841 completed 4% of database upgrade
                           39860:20170902:091730.982 completed 5% of database upgrade
                           39860:20170902:091732.552 completed 6% of database upgrade
                           39860:20170902:091734.721 completed 7% of database upgrade
                           39860:20170902:091735.476 completed 8% of database upgrade
                           39860:20170902:091736.560 completed 9% of database upgrade
                           39860:20170902:091742.667 slow query: 6.106615 sec, "alter table items drop column multiplier"
                           39860:20170902:091747.539 slow query: 4.824886 sec, "alter table items drop column data_type"
                           39860:20170902:091747.583 completed 10% of database upgrade
                           39860:20170902:091751.047 slow query: 3.463185 sec, "alter table items drop column delta"
                           39860:20170902:091751.538 completed 11% of database upgrade
                           39860:20170902:091751.712 completed 12% of database upgrade
                           39860:20170902:091751.808 completed 13% of database upgrade
                           39860:20170902:091754.528 completed 14% of database upgrade
                           39860:20170902:091830.164 completed 15% of database upgrade
                           39860:20170902:091831.207 completed 16% of database upgrade
                           39860:20170902:091832.332 completed 17% of database upgrade
                           39860:20170902:091833.573 completed 18% of database upgrade
                           39860:20170902:091834.849 completed 19% of database upgrade
                           39860:20170902:091836.077 completed 20% of database upgrade
                           39860:20170902:091836.161 completed 21% of database upgrade
                           39860:20170902:091836.688 completed 22% of database upgrade
                           39860:20170902:091837.509 completed 23% of database upgrade
                           39860:20170902:091841.463 slow query: 3.953568 sec, "alter table triggers modify error varchar(2048) default '' not null"
                           39860:20170902:091843.124 completed 24% of database upgrade
                           39860:20170902:091843.704 completed 25% of database upgrade
                           39860:20170902:091845.574 completed 26% of database upgrade
                           39860:20170902:091846.137 completed 27% of database upgrade
                           39860:20170902:091847.242 completed 28% of database upgrade
                           39860:20170902:091847.785 completed 29% of database upgrade
                           39860:20170902:091848.653 completed 30% of database upgrade
                           39860:20170902:091849.577 completed 31% of database upgrade
                           39860:20170902:091850.411 completed 32% of database upgrade
                           39860:20170902:091851.128 completed 33% of database upgrade
                           39860:20170902:091852.531 completed 34% of database upgrade
                           39860:20170902:091852.674 completed 35% of database upgrade
                           39860:20170902:091852.751 completed 36% of database upgrade
                           39860:20170902:091852.847 completed 37% of database upgrade
                           39860:20170902:091854.010 completed 38% of database upgrade
                           39860:20170902:091854.968 completed 39% of database upgrade
                           39860:20170902:091855.963 completed 40% of database upgrade
                           39860:20170902:091856.981 completed 41% of database upgrade
                           39860:20170902:091858.107 completed 42% of database upgrade
                           39860:20170902:091859.180 completed 43% of database upgrade
                           39860:20170902:091859.276 completed 44% of database upgrade
                           39860:20170902:091900.276 completed 45% of database upgrade
                           39860:20170902:091904.840 slow query: 4.513602 sec, "alter table items modify delay varchar(1024) default '0' not null"
                           39860:20170902:091904.962 completed 46% of database upgrade
                           39860:20170902:091909.763 slow query: 3.261788 sec, "alter table items drop column delay_flex"
                           39860:20170902:091909.802 completed 47% of database upgrade
                           39860:20170902:091914.452 slow query: 4.649540 sec, "alter table items modify history varchar(255) default '90d' not null"
                           39860:20170902:091914.560 completed 48% of database upgrade
                           39860:20170902:091919.245 slow query: 4.684135 sec, "alter table items modify trends varchar(255) default '365d' not null"
                           39860:20170902:091919.329 completed 49% of database upgrade
                           39860:20170902:091925.727 slow query: 4.564571 sec, "alter table items modify lifetime varchar(255) default '30d' not null"
                           39860:20170902:091925.763 completed 50% of database upgrade
                           39860:20170902:091927.380 completed 51% of database upgrade
                           39860:20170902:091928.478 completed 52% of database upgrade
                           39860:20170902:091929.496 completed 53% of database upgrade
                           39860:20170902:091930.473 completed 54% of database upgrade
                           39860:20170902:091931.485 completed 55% of database upgrade
                           39860:20170902:091932.431 completed 56% of database upgrade
                           39860:20170902:091933.384 completed 57% of database upgrade
                           39860:20170902:091934.319 completed 58% of database upgrade
                           39860:20170902:091935.241 completed 59% of database upgrade
                           39860:20170902:091936.171 completed 60% of database upgrade
                           39860:20170902:091937.112 completed 61% of database upgrade
                           39860:20170902:091938.070 completed 62% of database upgrade
                           39860:20170902:091938.968 completed 63% of database upgrade
                           39860:20170902:091939.969 completed 64% of database upgrade
                           39860:20170902:091940.939 completed 65% of database upgrade
                           39860:20170902:091941.946 completed 66% of database upgrade
                           39860:20170902:091942.814 completed 67% of database upgrade
                           39860:20170902:091942.935 completed 68% of database upgrade
                           39860:20170902:091943.096 completed 69% of database upgrade
                           39860:20170902:091943.199 completed 70% of database upgrade
                           39860:20170902:091947.117 slow query: 3.917290 sec, "alter table items add jmx_endpoint varchar(255) default '' not null"
                           39860:20170902:091947.541 completed 71% of database upgrade
                           39860:20170902:091948.602 completed 72% of database upgrade
                           39860:20170902:091949.298 completed 73% of database upgrade
                           39860:20170902:091949.598 [Z3005] query failed: [1050] Table 'dashboard' already exists [create table dashboard (
                          dashboardid bigint unsigned not null,
                          name varchar(255) not null,
                          userid bigint unsigned not null,
                          private integer default '1' not null,
                          primary key (dashboardid)
                          ) engine=innodb]
                           39860:20170902:091949.598 database upgrade failed
                          I changed the name to dashboard_2 and:

                          Code:
                          ---- cut ---
                          
                          * 40032: 20170902: 093032.850 completed 76% of database upgrade
                          * 40032: 20170902: 093032.898 completed 78% of database upgrade
                          * 40032: 20170902: 093032.946 completed 80% of database upgrade
                          * 40032: 20170902: 093032.989 completed 82% of database upgrade
                          * 40032: 20170902: 093033.025 completed 84% of database upgrade
                          * 40032: 20170902: 093033.061 completed 86% of database upgrade
                          * 40032: 20170902: 093033.097 completed 88% of database upgrade
                          * 40032: 20170902: 093033.133 completed 90% of database upgrade
                          * 40032: 20170902: 093033.169 completed 92% of database upgrade
                          * 40032: 20170902: 093033.204 completed 94% of database upgrade
                          * 40032: 20170902: 093033.240 completed 96% of database upgrade
                          * 40032: 20170902: 093033.276 completed 98% of database upgrade
                          * 40032: 20170902: 093033.312 completed 100% of database upgrade
                          * 40032: 20170902: 093033.312 database upgrade fully completed
                          And zabbix work:

                          Status of Zabbix

                          Parameter Value Details
                          Zabbix server is running Yes localhost:10051
                          Number of hosts (enabled/disabled/templates) 195 0 / 119 / 76
                          Number of items (enabled/disabled/not supported) 8034 0 / 8034 / 0
                          Number of triggers (enabled/disabled [problem/ok]) 4349 0 / 4349 [0 / 0]
                          Number of users (online) 19 1
                          Required server performance, new values per second 0
                          Updated: 09:32:14 AM


                          Will manual change to database be bad in the future?

                          Comment

                          • Lembit
                            Junior Member
                            • May 2011
                            • 1

                            #14
                            Originally posted by sccuser
                            Upgrading Zabbix to latest version was not my target, this was because of I unintentionally removed zabbix directories (php, configuration...) yesterday.

                            In order get my service back as quick, I was doing:
                            - remove all rest remaining of zabbix stuff
                            - download zabbix 3.4.0 from sourceforge.net
                            - recompile again
                            - re-configuration zabbix stuff (server, agent, proxy...)
                            - re-configuration php setting to point to current DB (MariaDB latest)
                            - and got error as described

                            Spent couple hours to troubleshoot, I end-up with workaround steps as doing drop several of existent tables and restart zabbix-server

                            Code:
                            $ mysql -u<user> -p<password> zabbix -e "drop table item_preproc;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table task_remote_command;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table task_remote_command_result;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table sysmap_shape;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table sysmap_element_trigger;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table httptest_field;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table httpstep_field;"
                            $ mysql -u<user> -p<password> zabbix -e "SET FOREIGN_KEY_CHECKS=0; drop table dashboard; SET FOREIGN_KEY_CHECKS=1;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table dashboard_user;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table dashboard_usrgrp;"
                            $ mysql -u<user> -p<password> zabbix -e "SET FOREIGN_KEY_CHECKS=0; drop table widget; SET FOREIGN_KEY_CHECKS=1;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table widget_field;"
                            $ mysql -u<user> -p<password> zabbix -e "drop table task_acknowledge;"
                            Hope it helps to others
                            Yes thx same here, helps !! save my day.

                            Comment

                            • Atsushi
                              Senior Member
                              • Aug 2013
                              • 2028

                              #15
                              If you are upgrading from a previous version of the database you do not need to load SQL(schema.sql, images.sql and data.sql) for Zabbix 3.4.

                              If you needed to delete the item_preproc table etc., you probably made you load SQL for Zabbix 3.4.

                              Please only load SQL for Zabbix 3.4 when installing newly.

                              Comment

                              Working...