-
Incident report
-
Resolution: Cannot Reproduce
-
Critical
-
None
-
3.0.1
-
SUSE Linux Enterprise Server 11 (x86_64) SP2
Zabbix 3.0.0
mysql Ver 14.14 Distrib 5.7.10, for Linux (x86_64) using EditLine wrapper
I have a Screen with six charts.
After same pages refresh I got the error (only occurs with remote database):
Error in query [UPDATE sessions SET lastaccess=1456967165 WHERE userid='12' AND sessionid='95ef87b58d4e97b813e2f58cf1926351'] [Deadlock found when trying to get lock; try restarting transaction]
Looking the code I found the update statement in the file include/classes/api/services/CUser.php
// don't check permissions on the same second if ($time != $userInfo['lastaccess']) { if (!check_perm2system($userInfo['userid'])) { self::exception(ZBX_API_ERROR_PARAMETERS, _('No permissions for system access.')); } if ($userInfo['autologout'] > 0) { DBexecute( 'DELETE FROM sessions'. ' WHERE userid='.zbx_dbstr($userInfo['userid']). ' AND lastaccess<'.(time() - $userInfo['autologout']) ); } DBexecute( 'UPDATE sessions'. ' SET lastaccess='.time(). ' WHERE userid='.zbx_dbstr($userInfo['userid']). ' AND sessionid='.zbx_dbstr($sessionid) ); }
I think the charts in same cases passes the test ($time != $userInfo['lastaccess']) and run more than one update in same times.
Maybe the page late somewhere and get a different value for $time.
It's possible check if page is a screen with multiple charts and run the update only once?