zabbix-server-mysql dist-upgrade (1.6.4 -> 1.8.1) fails because of SQL patch problem

Bug #562809 reported by ironstorm
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zabbix (Ubuntu)
New
Undecided
Unassigned

Bug Description

Debconf states that the database must be manually upgraded using a patch during Karmic -> Lucid dist-upgrade before Zabbix 1.8.x will run...

Attempting the SQL patch fails:
sudo sh -c "zcat /usr/share/doc/zabbix-server-mysql/examples/patch.sql.gz | mysql -D zabbix"

ERROR 1061 (42000) at line 68: Duplicate key name 'graphs_items_1'

Zabbix will then start with the following errors at the login page:
Error in query [SELECT g.usrgrpid FROM usrgrp g, users_groups ug WHERE ug.userid = 1 AND g.usrgrpid = ug.usrgrpid AND g.debug_mode = 1 LIMIT 1 OFFSET 0] [Unknown column 'g.debug_mode' in 'where clause']
mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/data/srv/www/htdocs/include/db.inc.php:546]
mysql_free_result(): supplied argument is not a valid MySQL result resource[/data/srv/www/htdocs/include/db.inc.php:548]

This can be worked around by running with the force option to get MySQL to complete the schema update and restarting Zabbix:

sudo sh -c "zcat /usr/share/doc/zabbix-server-mysql/examples/patch.sql.gz | mysql -f -D zabbix" # note -f 'force' is required.
sudo /etc/init.d/zabbix-server restart

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.