Ad Widget

Collapse

Zabbix database upgrade from 2.0 to 2.2 fails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andrea.consadori
    Member
    • Apr 2013
    • 94

    #1

    Zabbix database upgrade from 2.0 to 2.2 fails

    hi, this morning after a backup i start the upgrade but the log told me:

    [root@zabbix ~]# tail -f /var/log/zabbix/zabbix_server.log
    17252:20131113:090131.676 completed 1% of database upgrade
    17252:20131113:090131.742 completed 2% of database upgrade
    17252:20131113:090131.796 completed 3% of database upgrade
    17252:20131113:090134.202 completed 4% of database upgrade
    17252:20131113:090134.779 completed 5% of database upgrade
    17252:20131113:090135.152 completed 6% of database upgrade
    17252:20131113:090135.544 completed 7% of database upgrade
    17252:20131113:090135.863 completed 8% of database upgrade
    17252:20131113:090136.104 [Z3005] query failed: [1025] Error on rename of './zabbix/httptest' to './zabbix/#sql2-6d0f-be50f' (errno: 152) [alter table httptest drop foreign key c_httptest_1]
    17252:20131113:090136.104 database upgrade failed

    and the verbose one

    [root@zabbix zabbix]# tail -f /var/log/zabbix/zabbix_server.log
    18072:20131113:091057.946 current database version (mandatory/optional): 02010016/02010016
    18072:20131113:091057.946 required mandatory version: 02020000
    18072:20131113:091057.946 starting automatic database upgrade
    18072:20131113:091057.946 query [txnlev:1] [begin;]
    18072:20131113:091057.946 query [txnlev:1] [alter table httptest drop foreign key c_httptest_1]
    18072:20131113:091058.208 [Z3005] query failed: [1025] Error on rename of './zabbix/httptest' to './zabbix/#sql2-465f-7' (errno: 152) [alter table httptest drop foreign key c_httptest_1]
    18072:20131113:091058.208 query [alter table httptest drop foreign key c_httptest_1] failed, setting transaction as failed
    18072:20131113:091058.208 query [txnlev:1] [rollback;]
    18072:20131113:091058.208 database upgrade failed
    18072:20131113:091058.208 End of DBcheck_version():FAIL



    so what can i do now?
    Last edited by andrea.consadori; 13-11-2013, 10:11. Reason: log to 4
  • zalex_ua
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2009
    • 1286

    #2
    Question is - why "mysql" account cannot create new file (I suppose when renaming './zabbix/httptest' to './zabbix/#sql2-6d0f-be50f') while changing db schema ?

    File system permissions ?

    Comment

    • zalex_ua
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Oct 2009
      • 1286

      #3
      Later reported on bugs tracker https://support.zabbix.com/browse/ZBX-7346

      Comment

      • sducoin
        Junior Member
        • Dec 2011
        • 9

        #4
        incomplete database schema

        Hi,
        I had the same problem - (pgsql version) zabbix 2.0 to 2.2 fail due to an incomplete database schema. Here is the sql script that solve the problem for me :

        ALTER TABLE applications ADD CONSTRAINT applications_pkey PRIMARY KEY(applicationid);
        ALTER TABLE ONLY httptest ADD CONSTRAINT c_httptest_1 FOREIGN KEY (applicationid) REFERENCES applications (applicationid) ON DELETE CASCADE;
        ALTER TABLE ONLY applications ADD CONSTRAINT c_applications_2 FOREIGN KEY (templateid) REFERENCES applications (applicationid) ON DELETE CASCADE;

        after that launch the zabbix server daemon and that should just be all right

        cheers

        S.

        Comment

        Working...