[ZBX-10380] Zabbix Proxy upgrade from 2.4.7 to 3.0.0rc2 fail Created: 2016 Feb 12  Updated: 2017 May 30  Resolved: 2016 Feb 15

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P)
Affects Version/s: 3.0.0rc2
Fix Version/s: 3.0.0rc3

Type: Incident report Priority: Trivial
Reporter: Jean Baptiste Favre Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian Wheezy 7.9
MariaDB 10.1



 Description   

Trying to upgrade a fresh install of Zabbix Proxy.
DB upgrade fail at patch 2050055 with following error:

 16066:20160212:164604.982 query [txnlev:1] [begin;]
 16066:20160212:164604.983 query [txnlev:1] [alter table opinventory add constraint c_opinventory_1 foreign key (operationid) references operations (operationid) on delete cascade]
 16066:20160212:164605.003 query [txnlev:1] [update dbversion set mandatory=2050054,optional=2050054]
 16066:20160212:164605.004 query [txnlev:1] [commit;]
 16066:20160212:164605.004 completed 38% of database upgrade
 16066:20160212:164605.004 query [txnlev:1] [begin;]
 16066:20160212:164605.004 query [txnlev:1] [select severity_color_0,severity_color_1,severity_color_2,severity_color_3,severity_color_4,severity_color_5 from config]
 16066:20160212:164605.005 query [txnlev:1] [rollback;]
 16066:20160212:164605.005 database upgrade failed
 16066:20160212:164605.005 End of DBcheck_version():FAIL

From what I understand from DBpatch_2050055 function in file src/libs/zbxdbupgrade/dbupgrade_2050.c, my guess is that the select on line 501 returns no results.
The funtion exists at line 507 with default ret value, which is FAIL.
If no row returned, ret should be set to SUCCEED



 Comments   
Comment by Jean Baptiste Favre [ 2016 Feb 12 ]

According to https://dev.mysql.com/doc/refman/5.7/en/mysql-fetch-row.html, mysql-fetch-row returns NULL if there are no more rows to retrieve or if an error occurred.
Could we be in the first case ? No row at all means no more row to retrieve, right ?

Comment by Andris Mednis [ 2016 Feb 13 ]

Same error with PostgreSQL on fresh 2.4.7 proxy DB.

Comment by Andris Mednis [ 2016 Feb 13 ]

Proxy upgrade fails if 2.4.7 DB is created fresh - initially there are no records in 'config' table. When 2.4.7 proxy is up and running and it successfully gets configuration from Zabbix server then 1 row is inserted into 'config' table.
Now 2.4.7 proxy can be stopped and 3.0.0rc2 proxy can be started - now the upgrade will succeed.
So, this error will not happen on a really working 2.4.7 proxy.

Comment by Jean Baptiste Favre [ 2016 Feb 13 ]

Hello Andris,

Thanks for the update.
If this change is not mandatory, could it be possible to let it fail silently ?

Comment by Alexander Vladishev [ 2016 Feb 14 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-10380

Comment by Jean Baptiste Favre [ 2016 Feb 14 ]

Hello Alexander.
Will test the patch tomorrow.

Thanks

Comment by Alexander Vladishev [ 2016 Feb 15 ]

Fixed in pre-3.0.0rc3 r58433.

Generated at Fri Mar 29 15:14:56 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.