[ZBX-8424] Undefined index: eventid on Trigger page Created: 2014 Jul 02 Updated: 2017 May 30 Resolved: 2014 Sep 01 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F), Server (S) |
Affects Version/s: | 2.2.4 |
Fix Version/s: | 2.2.6rc1, 2.3.3 |
Type: | Incident report | Priority: | Major |
Reporter: | Evgeny Molchanov | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | events, undefinedindex | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | triggers_error.png | ||||
Issue Links: |
|
Description |
After update to 2.2.4 on page triggers: |
Comments |
Comment by Krists Krigers (Inactive) [ 2014 Jul 10 ] |
Lines 758 and 769 in file tr_status.php for version 2.2.4 (as downloaded from zabbix.com) do not have array element access with indexes reported in error message. |
Comment by Evgeny Molchanov [ 2014 Jul 10 ] |
Now is not a problem. Message on the page triggers missing. 'eventid='.$trigger['lastEvent']['eventid']. |
Comment by Evgeny Molchanov [ 2014 Jul 10 ] |
Version 2.2.4 with our minor modifications |
Comment by Krists Krigers (Inactive) [ 2014 Jul 15 ] |
We could not reproduce. More detailed explanation on how to repeat this behavior is necessary to proceed. If problem comes back, please supply more info. |
Comment by Oleksii Zagorskyi [ 2014 Jul 17 ] |
Well, I have the same errors on vanilla frontend 2.2.4, errors are: Undefined index: eventid [ in /var/www/html/tr_status.php:726] Undefined index: objectid [ in /var/www/html/tr_status.php:727] I know that such errors appear for triggers which were acknowledged. I don't have direct access to the frontend so it will take some time to figure out why these errors appear. |
Comment by Oleksii Zagorskyi [ 2014 Jul 22 ] |
There is confirmation that this issue appeared after 2.2.4 upgrade. I accidentally was able to "reproduce" it when worked on another issue It's reproducible after changes in SELECT e.* FROM events e WHERE e.objectid='13575' AND e.object='0' AND e.source='0' ORDER BY e.clock DESC,e.eventid DESC LIMIT 1 OFFSET 0 after:
SELECT e.* FROM ( SELECT e2.objectid,MAX(e2.clock) AS clock,MAX(e2.eventid) AS eventid FROM events e2 WHERE e2.object=0 AND e2.source=0 AND e2.objectid='13575' GROUP BY e2.objectid) e2, events e WHERE e.objectid=e2.objectid AND e.clock=e2.clock AND e.eventid=e2.eventid
In my tests I changed clock order to last or previous events (triggerid=13575) in a way that event with highest ID has clock which is less than previous event. In case when I changed the clock manually - the new SQL returns empty result and then we can see those Undefined index errors. BUT, from the production frontend I mentioned in previous comment I got saved html pages and I see there only correct order of eventIDs and their clock but the Undefined index errors are there as well. |
Comment by Oleksii Zagorskyi [ 2014 Jul 22 ] |
Evgeny, is it possible that you will save the page as html and attach it here (or send it to an email)? |
Comment by Oleksii Zagorskyi [ 2014 Jul 23 ] |
I have more details on my case. Please wait. |
Comment by Oleksii Zagorskyi [ 2014 Jul 23 ] |
In my "production case" issue appeared because that installation "migrated" from DM to standalone mode in manual fashion - as described bottom of So it's the same case as I emulated in previous comment. But, if we consider NEW zabbix code: $dbEvents = DBselect( 'SELECT '.$outputFields. ' FROM ('. ' SELECT e2.objectid,MAX(e2.clock) AS clock,MAX(e2.eventid) AS eventid'. ' FROM events e2'. ' WHERE e2.object='.EVENT_OBJECT_TRIGGER. ' AND e2.source='.EVENT_SOURCE_TRIGGERS. ' AND '.dbConditionInt('e2.objectid', $triggerids). ' GROUP BY e2.objectid'. ') e2, events e'. ' WHERE e.objectid=e2.objectid'. ' AND e.clock=e2.clock'. ' AND e.eventid=e2.eventid' ); we don't see any limitation for nodeID. added:
29237:20140723:161835.787 In process_events() events_num:1
29237:20140723:161835.788 In DCget_nextid() table:'events' num:1
29237:20140723:161835.788 query [txnlev:1] [select max(eventid) from events where eventid between 0 and 99999999999999]
So standalone server didn't notice outdated events from period when this server worked as node. Interesting, I'm not sure but I think it will be true also after migration to 2.4 |
Comment by Oleksii Zagorskyi [ 2014 Jul 23 ] |
Yeah, tested DM installation on 2.2.6rc1 and I see that frontend produces that SQL (new code) w/o nodeID limitations:
SELECT e.* FROM ( SELECT e2.objectid,MAX(e2.clock) AS clock,MAX(e2.eventid) AS eventid FROM events e2 WHERE e2.object=0 AND e2.source=0 AND e2.objectid='100100000013557' GROUP BY e2.objectid) e2, events e WHERE e.objectid=e2.objectid AND e.clock=e2.clock AND e.eventid=e2.eventid
when all other SQLs with the limitations. We started to forged about nodes too early |
Comment by Oleksii Zagorskyi [ 2014 Jul 31 ] |
In ZBX-8556 is a scenario how to reproduce described events order. |
Comment by Juris Miščenko (Inactive) [ 2014 Jul 31 ] |
[S] Fix implemented at svn://svn.zabbix.com/branches/dev/ZBX-8424 |
Comment by Oleksii Zagorskyi [ 2014 Aug 01 ] |
In the dev branch server does this SQL to search max eventids: According to svn log message. |
Comment by Juris Miščenko (Inactive) [ 2014 Aug 01 ] |
Server side's fix merged in pre-2.2.6 r47725. |
Comment by Ivo Kurzemnieks [ 2014 Aug 01 ] |
(2) Frontend code requires modification. iivs RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-8424 r47795 sasha CLOSED |
Comment by Ivo Kurzemnieks [ 2014 Aug 05 ] |
Finding last event for triggers is now fixed in frontend. Fixed in pre-2.2.6rc1 r47812 and pre-2.3.3 r47813 |
Comment by Pavels Jelisejevs (Inactive) [ 2014 Aug 29 ] |
(5) Please update the API changelog. A more detailed entry would be preferable. iivs Changes described here https://www.zabbix.com/documentation/2.2/manual/api/changes_2.2?do=diff&rev2[0]=1408108783&rev2[1]=&difftype=sidebyside jelisejev Thanks, CLOSED. |