[ZBX-3407] DB2 fetch failure Created: 2011 Jan 12  Updated: 2017 May 30  Resolved: 2014 Sep 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 1.8.4
Fix Version/s: 1.8.21rc1, 2.0.13rc1, 2.2.7rc1, 2.3.5

Type: Incident report Priority: Critical
Reporter: Igor Danoshaites (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: db2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

v1.8.4, DB: DB2


Attachments: Text File db2_fix_Fetch-Failure.patch     JPEG File screenshot-1.jpg     PNG File zabbix_bug_frontend.PNG    
Issue Links:
Duplicate
is duplicated by ZBX-3543 Dashboard PHP Error w/ DB2 Backend Closed
is duplicated by ZBX-4039 db2_fetch_assoc(): Fetch Failure [inc... Closed

 Description   

In Zabbix v1.8.4 appears the following error in the "Monitoring->Dashboard" report: DB2 fetch failure. Please see attached screenshot for more details.



 Comments   
Comment by richlv [ 2011 Jan 12 ]

interestingly, new values per second shows 0 for that system. are all items trapper ones ?

Comment by Vladimir Barcevsky (Inactive) [ 2011 Jan 18 ]

cannot reproduce in branch revision 16988

Comment by Igor Danoshaites (Inactive) [ 2011 Feb 17 ]

Hi all,

Please find a patch file "db2_fix_Fetch-Failure.patch" in the attachment to this issue for fixing this issue.
It will patch only one php file: "include/db.inc.php".

For this patch installation you need to perform the following actions:

1. cd zabbix
2. execute the following command: "cat db2_fix_Fetch-Failure.patch|patch -p0"

Comment by richlv [ 2011 Feb 17 ]

i can't find this issue in the changelog, so it most likely hasn't been fixed - if the patch is confirmed to work ok and merged, then this could be closed

Comment by Kelly Fitzgerald [ 2011 Aug 12 ]

i did in fact run the patch and i am still getting the identical error...

nalvsvzabbix01t:/usr/local/zend/apache2/htdocs/zabbix # cat db2_fix_Fetch-Failure.patch|patch -p0
patching file include/db.inc.php
Hunk #1 succeeded at 473 (offset 7 lines).

Shall i present my db.inc.php file? how should we next proceed?

Comment by Kelly Fitzgerald [ 2011 Aug 12 ]

When i diffed it, the changes were made.

nalvsvzabbix01t:/usr/local/zend/apache2/htdocs/zabbix/include # diff db.inc.php db.inc.php.orig
476c476
< if(!$result = db2_prepare($DB['DB'], $query, $options)){

> if(!$result = db2_prepare($DB['DB'], $query)){
480c480
< else if(true !== @db2_execute($result)){

> else if(true !== @db2_execute($result, $options)){

Comment by Igor Danoshaites (Inactive) [ 2011 Aug 12 ]

Hi,

Thank you for the update.

Let our PHP developer check this.

Comment by Kelly Fitzgerald [ 2011 Aug 12 ]

this error also shows up on the reports page

http://172.25.17.82/zabbix/report1.php?sid=55c2ad22a84e92bb

Comment by Kelly Fitzgerald [ 2011 Aug 12 ]

please have a look at the php manual... it appears Zabbix may be trying to implement too many =options in the db2_fetch, in particular the community notes at the bottom of the page.

http://php.net/manual/en/function.db2-prepare.php

"Will result in the following error:

Warning: db2_fetch_both() [function.db2-fetch-both]: Fetch Failure in dbtest.php on line 7

In fact, even if you set the options on both the connection and the prepare your fetch will not work. You must only set that option on the prepare."

Comment by AlexVieira [ 2012 Oct 22 ]

I have the same error on zabix 2.0.

Comment by Rob Williams [ 2013 Jun 13 ]

There is an issue with numeric types with the following query on the front dash board which generates the db2_fetch error:

db2inst1@monitor:~$ db2 "SELECT SUM(1.0/i.delay) AS qps FROM zabbix.items i,zabbix.hosts h WHERE i.status=0 AND i.hostid=h.hostid AND h.status=0 AND i.delay<>0"

QPS
---------------------------------
SQL0802N  Arithmetic overflow or other arithmetic exception occurred.


Fix:
---------------------------------------
db2inst1@monitor:~$ db2 "SELECT SUM(1.0/cast(i.delay as double)) AS qps FROM zabbix.items i,zabbix.hosts h WHERE i.status=0 AND i.hostid=h.hostid AND h.status=0 AND i.delay<>0"

QPS
------------------------
  +3.42598198537940E+001



Patch for ./include/config.inc.php:

664         $row = DBfetch(DBselect(
665                 'SELECT SUM(1/cast(i.delay as double)) AS qps'.
666                 ' FROM items i,hosts h'.
667                 ' WHERE i.status='.ITEM_STATUS_ACTIVE.
668                         ' AND i.hostid=h.hostid'.
669                         ' AND h.status='.HOST_STATUS_MONITORED.
670                         ' AND i.delay<>0'
671         ));
672         $status['qps_total'] = round($row['qps'], 2);
Comment by Oleg Ivanivskyi [ 2014 Mar 17 ]

Looks like not Zabbix issue. I can't reproduce it on DB2 10.5 fp1 and SLES11 SP3 x86_64.

Comment by Oleg Ivanivskyi [ 2014 Aug 29 ]

Can reproduce if NVPS is more than 10.

Comment by Krists Krigers (Inactive) [ 2014 Sep 01 ]

Fixed in r48628, branch svn://svn.zabbix.com/branches/dev/ZBX-3407.

kristsk As this issue has to be fixed from 2.0, this branch is removed (was made from 2.2).

Comment by Alexander Vladishev [ 2014 Sep 02 ]

(1) Please fix it in from version 2.0.x

kristsk RESOLVED in r48661, branch svn://svn.zabbix.com/branches/dev/ZBX-3407-20.

sasha CLOSED

Comment by Alexander Vladishev [ 2014 Sep 02 ]

(2) The same problem can be in proxies.php

kristsk Checked, same problem found. RESOLVED in r48661, branch svn://svn.zabbix.com/branches/dev/ZBX-3407-20.

sasha CLOSED

Comment by Alexander Vladishev [ 2014 Sep 02 ]

(3) Please review my changes in r48667

kristsk CLOSED.

Comment by Alexander Vladishev [ 2014 Sep 02 ]

(4) The solution doesn't work. I receive the same error.

kristsk RESOLVED in r48672.

sasha CLOSED

Comment by Krists Krigers (Inactive) [ 2014 Sep 02 ]

Fixed and merged to:

  • 1.8.21rc1 in r48678,
  • 2.0.13rc1 in r48677,
  • 2.2.7rc1 in r48679,
  • 2.3.5 (trunk) in r48681.
Generated at Fri Mar 29 06:49:35 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.