[ZBX-23179] Zabbix Database Import. 5.4 version to 6.4. Created: 2023 Jul 31  Updated: 2023 Aug 08  Resolved: 2023 Aug 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Victor Florêncio Assignee: Zabbix Support Team
Resolution: Commercial support required Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi everyone.

I've tried to update my Zabbix 5.4 to 6.4 version.

Scenario:

1 - We had an old Centos 7 with Zabbix 5.4

2 - I started up a new server Centos 9 

3 - Configured the new server with Zabbix Settings (6.4) to receive the Database from the Zabbix 5.4

4 - I finished the database import: mysql -u root zabbix < /bkpzabbix/zabbix_backup.sql

5 - update dbversion set mandatory=06040000,optional=06040000;

6 - The Zabbix Database Update automatic didn't occurr as expected

7 - Received the log below:

 24235:20230731:144350.606 using configuration file: /etc/zabbix/zabbix_server.conf
 24235:20230731:144350.817 current database version (mandatory/optional): 06040000/06040000
 24235:20230731:144350.817 required mandatory version: 06040000
 24235:20230731:144350.817 optional patches were found
 24235:20230731:144350.817 starting automatic database upgrade
 24235:20230731:144350.832 [Z3005] query failed: [1072] Key column 'cause_eventid' doesn't exist in table [create index problem_4 on problem (cause_eventid)]
 24235:20230731:144350.832 database upgrade failed on patch 06040001, exiting in 10 seconds

8 - It's not seems related with 'history' entries in database problems (I tried to prepare the database before de import again: mysql -u zabbix -p zabbix < /usr/share/zabbix-sql-scripts/mysql/history_pk_prepare.sql

9 - Same log errors as the step 7.

I don't know where to go here. Can someone help me to proceed please?

thanks.

 

I don't k



 Comments   
Comment by Victor Florêncio [ 2023 Jul 31 ]

More informations:

mysql> show columns from zabbix.opcommand;
+-------------+-----------------+------+-----+---------+-------+
| Field       | Type            | Null | Key | Default | Extra |
+-------------+-----------------+------+-----+---------+-------+
| operationid | bigint unsigned | NO   | PRI | NULL    |       |
| type        | int             | NO   |     | 0       |       |
| scriptid    | bigint unsigned | NO   | MUL | NULL    |       |
| execute_on  | int             | NO   |     | 0       |       |
| port        | varchar(64)     | NO   |     |         |       |
| authtype    | int             | NO   |     | 0       |       |
| username    | varchar(64)     | NO   |     |         |       |
| password    | varchar(64)     | NO   |     |         |       |
| publickey   | varchar(64)     | NO   |     |         |       |
| privatekey  | varchar(64)     | NO   |     |         |       |
| command     | text            | NO   |     | NULL    |       |
+-------------+-----------------+------+-----+---------+-------+
Comment by Edgar Akhmetshin [ 2023 Aug 01 ]

Hello

Step 5 is not needed and incorrect since Zabbix Server binary will do the database upgrade itself. Doing this manually without proper knowledge just skips all the the upgrade and you have this errors.

Upgrade procedure:
https://www.zabbix.com/documentation/current/en/manual/installation/upgrade

Be advised that this section of the tracker is for bug reports only. The case you have submitted can not be qualified as one, so please reach out to [email protected] for commercial support (https://zabbix.com/support) or consultancy services. Alternatively, you can also use our IRC channel or community forum (https://www.zabbix.com/forum) for assistance. With that said, we are closing this ticket. Thank you for understanding.

Regards,
Edgar

Comment by Victor Florêncio [ 2023 Aug 01 ]

Hi Edgar.

I've tried that too, check the result. I couldn't proceed also.

 

 36305:20230801:085731.865 IPv6 support:              YES
 36305:20230801:085731.865 TLS support:               YES
 36305:20230801:085731.865 ******************************
 36305:20230801:085731.865 using configuration file: /etc/zabbix/zabbix_server.conf
 36305:20230801:085731.884 current database version (mandatory/optional): 05000000/05000005
 36305:20230801:085731.884 required mandatory version: 06040000
 36305:20230801:085731.884 mandatory patches were found
 36305:20230801:085731.886 [Z3005] query failed: [1054] Unknown column 'ha_failover_delay' in 'field list' [select unix_timestamp(),ha_failover_delay from config]
 36305:20230801:085731.886 cannot retrieve database time
 36305:20230801:085731.886 Zabbix Server stopped. Zabbix 6.4.4 (revision a749236b3d9).

 

What am I missing here?

Comment by Victor Florêncio [ 2023 Aug 01 ]

Hi Edgar.

I've tried that too, check the result. I couldn't proceed also.

 

 36305:20230801:085731.865 IPv6 support:              YES
 36305:20230801:085731.865 TLS support:               YES
 36305:20230801:085731.865 ******************************
 36305:20230801:085731.865 using configuration file: /etc/zabbix/zabbix_server.conf
 36305:20230801:085731.884 current database version (mandatory/optional): 05000000/05000005
 36305:20230801:085731.884 required mandatory version: 06040000
 36305:20230801:085731.884 mandatory patches were found
 36305:20230801:085731.886 [Z3005] query failed: [1054] Unknown column 'ha_failover_delay' in 'field list' [select unix_timestamp(),ha_failover_delay from config]
 36305:20230801:085731.886 cannot retrieve database time
 36305:20230801:085731.886 Zabbix Server stopped. Zabbix 6.4.4 (revision a749236b3d9).

 

What am I missing here? 

Comment by Edgar Akhmetshin [ 2023 Aug 02 ]

36305:20230801:085731.886 [Z3005] query failed: [1054] Unknown column 'ha_failover_delay' in 'field list' [select unix_timestamp(),ha_failover_delay from config]

Do not touch dbversion table.

36305:20230801:085731.884 current database version (mandatory/optional): 05000000/05000005

This is not 5.4 vanilla version number.

Revert back database state from the backup and start over without dbversion table manual changes.

Be advised that this section of the tracker is for bug reports only. The case you have submitted can not be qualified as one, so please reach out to [email protected] for commercial support (https://zabbix.com/support) or consultancy services. Alternatively, you can also use our IRC channel or community forum (https://www.zabbix.com/forum) for assistance. With that said, we are closing this ticket. Thank you for understanding.

Closing as "Commercial support required".

Comment by Victor Florêncio [ 2023 Aug 07 ]

Edgar,

Hi.

I reimported the database and didn`t change the version.

Tried to start the zabbix-server and I got those logs below:

 41947:20230807:080650.139 IPv6 support:              YES
 41947:20230807:080650.139 TLS support:               YES
 41947:20230807:080650.139 ******************************
 41947:20230807:080650.139 using configuration file: /etc/zabbix/zabbix_server.conf
 41947:20230807:080650.379 current database version (mandatory/optional): 05000000/05000005
 41947:20230807:080650.379 required mandatory version: 06040000
 41947:20230807:080650.379 mandatory patches were found
 41947:20230807:080650.389 [Z3005] query failed: [1054] Unknown column 'ha_failover_delay' in 'field list' [select unix_timestamp(),ha_failover_delay from config]
 41947:20230807:080650.389 cannot retrieve database time
 41947:20230807:080650.389 Zabbix Server stopped. Zabbix 6.4.4 (revision a749236b3d9).

What Can I do from here?

Comment by Victor Florêncio [ 2023 Aug 07 ]

I created a COLUMN 'ha_failover_delay in MySQL and proceed:

 

  3838:20230807:095511.668 7fd9dfdba000-7fd9dfdbc000 r--p 00033000 fd:00 805308634                  /usr/lib64/ld-linux-x86-64.so.2
  3838:20230807:095511.668 7fd9dfdbc000-7fd9dfdbe000 rw-p 00035000 fd:00 805308634                  /usr/lib64/ld-linux-x86-64.so.2
  3838:20230807:095511.668 7ffe5480f000-7ffe54830000 rw-p 00000000 00:00 0                          [stack]
  3838:20230807:095511.668 7ffe548dc000-7ffe548e0000 r--p 00000000 00:00 0                          [vvar]
  3838:20230807:095511.668 7ffe548e0000-7ffe548e2000 r-xp 00000000 00:00 0                          [vdso]
  3838:20230807:095511.668 ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0                  [vsyscall]
  3838:20230807:095511.668 ================================
  3838:20230807:095511.668 Please consider attaching a disassembly listing to your bug report.
  3838:20230807:095511.668 This listing can be produced with, e.g., objdump -DSswx zabbix_server.
  3838:20230807:095511.668 ================================

 

Now I'm getting this errors.

Comment by Victor Florêncio [ 2023 Aug 07 ]

I Also got this at the beginning of zabbix_server.log:

  2709:20230807:090758.896 using configuration file: /etc/zabbix/zabbix_server.conf
  2709:20230807:090758.910 current database version (mandatory/optional): 05000000/05000005
  2709:20230807:090758.911 required mandatory version: 06040000
  2709:20230807:090758.911 mandatory patches were found
  2709:20230807:090758.912 Got signal [signal:11(SIGSEGV),reason:1,refaddr:(nil)]. Crashing ...
  2709:20230807:090758.912 ====== Fatal information: ======
  2709:20230807:090758.912 Program counter: 0x562958bffa7a
  2709:20230807:090758.912 === Registers: ===

Comment by Victor Florêncio [ 2023 Aug 07 ]

Backtrace:

 

  4184:20230807:101206.288 === Backtrace: ===
  4184:20230807:101206.289 10: /usr/sbin/zabbix_server(zbx_backtrace+0x46) [0x557e91bc2766]
  4184:20230807:101206.289 9: /usr/sbin/zabbix_server(zbx_log_fatal_info+0x295) [0x557e91bc2ae5]
  4184:20230807:101206.289 8: /usr/sbin/zabbix_server(+0x2f2096) [0x557e91bc3096]
  4184:20230807:101206.289 7: /lib64/libc.so.6(+0x54df0) [0x7fd81a454df0]
  4184:20230807:101206.289 6: /usr/sbin/zabbix_server(zbx_is_time_suffix+0xa) [0x557e91be1a7a]
  4184:20230807:101206.289 5: /usr/sbin/zabbix_server(DBcheck_version+0x794) [0x557e91b3c464]
  4184:20230807:101206.289 4: /usr/sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x66a) [0x557e9195eb8a]
  4184:20230807:101206.289 3: /usr/sbin/zabbix_server(main+0x242) [0x557e91953f12]
  4184:20230807:101206.289 2: /lib64/libc.so.6(+0x3feb0) [0x7fd81a43feb0]
  4184:20230807:101206.289 1: /lib64/libc.so.6(__libc_start_main+0x80) [0x7fd81a43ff60]
  4184:20230807:101206.289 0: /usr/sbin/zabbix_server(_start+0x25) [0x557e9195b215]

Comment by Ilja Fedotjevs [ 2023 Aug 08 ]

Dear Victor,
please be advised that this section of the tracker is for bug reports only. The case you have submitted can not be qualified as one, so please reach out to [email protected] for commercial support (https://zabbix.com/support) or consultancy services. Alternatively, you can also use our IRC channel or community forum (https://www.zabbix.com/forum) for assistance. With that said, we are closing this ticket. Thank you for understanding.

BR,

Zabbix support

Generated at Sat Aug 02 09:21:16 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.