[ZBX-7191] Unhandled ODBC monitoring error should not bring down zabbix server Created: 2013 Oct 23  Updated: 2022 Jul 28  Resolved: 2013 Oct 25

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.1.8
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Arli Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: odbc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Zabbix 2.1.8 (second beta)
OEL 6.4
unixODBC-2.2.14
mysql-connector-odbc -5.1.5r1144



 Description   

When database monitoring feature encounters ODBC exception it can't handle, then instead of just marking this item as Not supported, the entire zabbix server shuts down. Would be nice, if that error would not have so dramatic consequences and Zabbix server could stay alive after that.
For example:

Handled error
24561:20131023:141301.255 In odbc_DBconnect() db_dsn:'nosuchdb.mydomain.com' user:'myuser'
24561:20131023:141301.256 odbc_Diag(): rc_msg:'SQL_ERROR' rec_nr:1 sql_state:'IM002' native_err_code:0 err_msg:'[unixODBC][Driver Manager]Data source name not found, and no default driver specified'
24561:20131023:141301.256 End of odbc_DBconnect():FAIL
24561:20131023:141301.256 End of get_value_db():NOTSUPPORTED

Un-handled error
20951:20131023:125501.034 In odbc_DBconnect() db_dsn:'myserver.mydomain.com' user:'myuser'
/opt/zabbix/sbin/zabbix_server: poller #1 [got 1 values in 0.077962 sec, getting values]: relocation error: /usr/lib64/libmyodbc5.so: symbol strmov, version libmysqlclient_16 not defined in file libmysqlclient_r.so.16 with link time reference
20945:20131023:125501.044 One child process died (PID:20951,exitcode/signal:127). Exiting ...
20945:20131023:125501.044 zbx_on_exit() called



 Comments   
Comment by Aleksandrs Saveljevs [ 2013 Oct 24 ]

It seems to me that this is a library problem, not a Zabbix problem, because "relocation error" is a problem reported by the linker. Zabbix server cannot (and probably should not) do anything about it.

Comment by Arli [ 2013 Oct 24 ]

Yes, it is a library problem. I'm just suggesting that maybe entire Zabbix server should not die when badly configured ODBC driver throws an exception.

Comment by richlv [ 2013 Oct 24 ]

this one seems to be more than a simple misconfiguration, though - there's a library issue. not sure zabbix even can ignore that...

Comment by Aleksandrs Saveljevs [ 2013 Oct 25 ]

This is not an exception thrown by ODBC, it is an error signalled by operating system's linker. So I do not think Zabbix should be doing anything about it.

Comment by Glebs Ivanovskis (Inactive) [ 2016 Jul 01 ]

UnixODBC is very clever, it loads ODBC drivers at runtime. Drivers must be linked against DB client libraries, so they must be loaded at runtime too as a secondary dependency. Problems start when application using unixODBC is linked against DB client library directly (like Zabbix), especially when ODBC driver and the application request different (potentially incompatible) versions of the same library. Hence crashes and symbol lookup problems.

Generated at Sat Apr 20 05:47:50 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.