Ad Widget

Collapse

Patch.sql 1.6.8 -> 1.8.1 : "Duplicate key name" error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • befortin
    Member
    • Jul 2005
    • 48

    #1

    Patch.sql 1.6.8 -> 1.8.1 : "Duplicate key name" error

    Hi,

    I'm having some issues, trying to upgrade from Zabbix 1.6.8 to Zabbix 1.8.1.

    I'm following the upgrade procedure (http://www.zabbix.com/documentation/...tion/upgrading) step-by-step, and here's what happens :

    1. When I try to drop the actions_1 index :
    Code:
    "mysql> alter table actions drop index actions_1;
    ERROR 1091 (42000): Can't DROP 'actions_1'; check that column/key exists"
    2. Then, when running the patch :
    Code:
    root@srvcgimon:/home/ce42999/zabbix-1.8.1/upgrades/dbpatches/1.8/mysql# mysql -uroot -ppassword zabbix < patch.sql
    ERROR 1061 (42000) at line 1: Duplicate key name 'actions_1'
    How is this possible!?

    Thanks!
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    altering the same database on the same server in the first step ?
    Zabbix 3.0 Network Monitoring book

    Comment

    • alj
      Senior Member
      • Aug 2006
      • 188

      #3
      Originally posted by befortin
      Hi,

      I'm having some issues, trying to upgrade from Zabbix 1.6.8 to Zabbix 1.8.1.

      I'm following the upgrade procedure (http://www.zabbix.com/documentation/...tion/upgrading) step-by-step, and here's what happens :

      1. When I try to drop the actions_1 index :
      Code:
      "mysql> alter table actions drop index actions_1;
      ERROR 1091 (42000): Can't DROP 'actions_1'; check that column/key exists"
      2. Then, when running the patch :
      Code:
      root@srvcgimon:/home/ce42999/zabbix-1.8.1/upgrades/dbpatches/1.8/mysql# mysql -uroot -ppassword zabbix < patch.sql
      ERROR 1061 (42000) at line 1: Duplicate key name 'actions_1'
      How is this possible!?

      Thanks!
      it is possible if you didn't do "use zabbix" during first step.

      Comment

      • befortin
        Member
        • Jul 2005
        • 48

        #4
        Thanks!

        Actually, I don't know what went wrong at first... So I restored the database, converted it to UTF-8 (took about 20 hours on a dual CPU, 8 GB server!!, and then converted the database to 1.8.1 (successfully).

        Comment

        • alj
          Senior Member
          • Aug 2006
          • 188

          #5
          Originally posted by befortin
          Thanks!

          Actually, I don't know what went wrong at first... So I restored the database, converted it to UTF-8 (took about 20 hours on a dual CPU, 8 GB server!!, and then converted the database to 1.8.1 (successfully).
          You probably interrupted patch.sql and tried to run it 2-nd time. It doesn't work unless you restart patch.sql where it stopped (just delete line that generates error + all lines above it).

          About 20 hour conversion - read this thread

          if you patch sh script it takes rather 20 minutes instead of 20 hours, which makes me think that developers don't really have big history database to test those kind of things. In my case it would take days to convert it assuming i had free disk space to alter huge tables.

          Comment

          Working...