I'm trying to upgrade Zabbix to 6.0.9 from 5.2.4 and I'm receiving this error
Versions (pre → post upgrade)
Process to followed to upgrade
One thing to note is I removed the csv files located in /tmp/ that are generated by the manual primary key upgrade, before starting zabbix as the disk space is limited, are these files needed for the database upgrade beyond the manual upgrade for primary keys?
zabbix_server.log
Code:
[Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR: there is no unique constraint matching given keys for referenced table "problem"
- Ubuntu 20.04 LTS
- Zabbix 5.2.4 → 6.0.9
- PostgreSQL 12.12 → 14.5-1
- TimescaleDB 1.7.4 → 2.7.0
Process to followed to upgrade
- Installed PostgreSQL 14.5
- Upgraded TimescaleDB using the instructions Upgrade TimescaleDB for both pgsql 12 & 14.
- Perform a pg_clusterupgrade using --method=upgrade and --link, linking my data dirs /mnt/Data/postgresql/12/main and /mnt/Data/postgresql14/main
- Upgraded to Zabbix 6.0.9 using the instructions Upgrade Procedure
- Following Upgrade notes for 6.0.0 I need to perform a manual upgrade of history tables to primary keys for PostgreSQL + TimescaleDB.
- Start zabbix-server, and database upgrade fails.
One thing to note is I removed the csv files located in /tmp/ that are generated by the manual primary key upgrade, before starting zabbix as the disk space is limited, are these files needed for the database upgrade beyond the manual upgrade for primary keys?
zabbix_server.log
Code:
71078:20221015:113759.199 Starting Zabbix Server. Zabbix 6.0.9 (revision 64721203c07). 71078:20221015:113759.199 ****** Enabled features ****** 71078:20221015:113759.199 SNMP monitoring: YES 71078:20221015:113759.199 IPMI monitoring: YES 71078:20221015:113759.199 Web monitoring: YES 71078:20221015:113759.199 VMware monitoring: YES 71078:20221015:113759.200 SMTP authentication: YES 71078:20221015:113759.200 ODBC: YES 71078:20221015:113759.200 SSH support: YES 71078:20221015:113759.200 IPv6 support: YES 71078:20221015:113759.200 TLS support: YES 71078:20221015:113759.200 ****************************** 71078:20221015:113759.200 using configuration file: /etc/zabbix/zabbix_server.conf 71078:20221015:113759.316 current database version (mandatory/optional): 05050006/05050006 71078:20221015:113759.316 required mandatory version: 06000000 71078:20221015:113759.316 optional patches were found 71078:20221015:113759.316 starting automatic database upgrade 71078:20221015:113759.317 [Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR: there is no unique constraint matching given keys for referenced table "problem" [alter table service_problem add constraint c_service_problem_1 foreign key (eventid) references problem (eventid) on delete cascade] 71078:20221015:113759.318 database upgrade failed
Comment