Upgrade Error When Upgrading from Zabbix 3.4 to 4.0

November 04, 2018

Upgrading from Zabbix 3.4 to 4.0 and zabbix-server won't start?  Depending on the issue, this may be the fix you're looking for.

Symptoms

After upgrading from 3.4 to 4.0, browsing the web interface of Zabbix results in the following message:

Database error:
The frontend does not match Zabbix database. Current database version (mandatory/optional): 3050110/3050110. Required mandatory version: 4000000. Contact your system administrator.

The upgrade of the database that it is talking about should have happened automagically during the start of the zabbix-server service.  Unfortunately, upon further investigation, the service would not start.  By viewing the log associated with the service (/var/log/zabbix/zabbix_server.log), we can see the following error:

Duplicate column name 'name' [alter table `events` add `name` varchar(2048) default '' not null]

The Fix

In order to start the automatic DB upgrade, we must first clear this error.  Open connection to your DB and run the following query:

mysql -u $zabbix-user -p
USE $zabbix-db-name;
ALTER TABLE events DROP COLUMN name;
exit

The zabbix-server service should now start successfully and being the upgrade.  You can watch its progress by viewing: /var/log/zabbix/zabbix_server.log.


Additional Reading

©2024 Tyler Wright