ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7108

Unsuccessful database migration for Proxies

    Details

      Description

      According to https://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes#upgrade_notes_for_proxies we tried to perform a upgrade of our zabbix proxies.
      (Upgraded procedure for server runs for two hours and we do not want to lose the data collected while upgraded in the schema of the main server)

      While performing a upgrade at the proxy we get this:

      --------------
      SET @graphthemeid = (SELECT MAX(graphthemeid) FROM graph_theme)
      --------------
      
      --------------
      INSERT INTO graph_theme (graphthemeid, description, theme, backgroundcolor, graphcolor, graphbordercolor, gridcolor, maingridcolor, gridbordercolor, textcolor, highlightcolor, leftpercentilecolor, rightpercentilecolor, nonworktimecolor, gridview, legendview)
      VALUES
      (@graphthemeid + 1, 'Dark orange', 'darkorange', '333333', '0A0A0A', '888888', '222222', '4F4F4F', 'EFEFEF', 'DFDFDF', 'FF5500', 'FF5500', 'FF1111', '1F1F1F', 1, 1),
      (@graphthemeid + 2, 'Classic', 'classic', 'F0F0F0', 'FFFFFF', '333333', 'CCCCCC', 'AAAAAA', '000000', '222222', 'AA4444', '11CC11', 'CC1111', 'E0E0E0', 1, 1)
      --------------
      
      ERROR 1062 (23000) at line 223: Duplicate entry '0' for key 'PRIMARY'
      

      After adding the following hack to the database the upgrade is sucessful:

      # diff -u patch.sql patch-fixed.sql
      --- patch.sql	2013-10-07 12:40:18.340144674 +0200
      +++ patch-fixed.sql	2013-10-07 12:40:08.292000626 +0200
      @@ -220,6 +220,7 @@
       
       -- Insert new graph theme
       SET @graphthemeid = (SELECT MAX(graphthemeid) FROM graph_theme);
      +SET @graphthemeid =(SELECT IFNULL(@graphthemeid,0));
       INSERT INTO graph_theme (graphthemeid, description, theme, backgroundcolor, graphcolor, graphbordercolor, gridcolor, maingridcolor, gridbordercolor, textcolor, highlightcolor, leftpercentilecolor, rightpercentilecolor, nonworktimecolor, gridview, legendview)
       VALUES
       (@graphthemeid + 1, 'Dark orange', 'darkorange', '333333', '0A0A0A', '888888', '222222', '4F4F4F', 'EFEFEF', 'DFDFDF', 'FF5500', 'FF5500', 'FF1111', '1F1F1F', 1, 1),
      

        Activity

        Hide
        richlv added a comment -

        although this shows that we should have a separate patch for proxy db, graph themes do not make much sense there...

        Show
        richlv added a comment - although this shows that we should have a separate patch for proxy db, graph themes do not make much sense there...
        Hide
        Javier Barroso added a comment -

        Seems like with mysql 5.6 it is necessary the patch proposed in this ticket.

        I was updating from zabbix 1.8.10 to 2.0 => 2.4.6

        I would suggest updating 2.0.x patch.mysql with the patch

        Thank you

        Show
        Javier Barroso added a comment - Seems like with mysql 5.6 it is necessary the patch proposed in this ticket. I was updating from zabbix 1.8.10 to 2.0 => 2.4.6 I would suggest updating 2.0.x patch.mysql with the patch Thank you
        Hide
        richlv added a comment -

        another proxy db upgrade problem : ZBX-11224

        Show
        richlv added a comment - another proxy db upgrade problem : ZBX-11224
        Hide
        Vladislavs Sokurenko added a comment -

        Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7108
        Now graph_theme data will only be added if data for it exists ( server database )

        Show
        Vladislavs Sokurenko added a comment - Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7108 Now graph_theme data will only be added if data for it exists ( server database )
        Hide
        Alexander Vladishev added a comment -

        Successfully tested. Have a look at my changes in r62626 before a merge.

        Show
        Alexander Vladishev added a comment - Successfully tested. Have a look at my changes in r62626 before a merge.
        Hide
        Vladislavs Sokurenko added a comment - - edited

        merged in:

        • 2.0.19rc1 r62669
        • 2.2.15rc1 r62671
        • 3.0.5rc1 r62672
        • 3.2.1rc1 r62673
        • 3.3.0 (trunk) r62675
        Show
        Vladislavs Sokurenko added a comment - - edited merged in: 2.0.19rc1 r62669 2.2.15rc1 r62671 3.0.5rc1 r62672 3.2.1rc1 r62673 3.3.0 (trunk) r62675

          People

          • Assignee:
            Unassigned
            Reporter:
            Marc Schoechlin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: