-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
3.0.0alpha3
Zabbix FE show maintenance message when DB version does not match expected version.
Steps to reproduce:
- Use an older DB Version (my case: 2050061)
- Edit conf/maintenance.inc.php
- Define ZBX_DENY_GUI_ACCESS to 0 (or 1, but this would be expected)
- Set an array WITHOUT your ip value to $ZBX_GUI_ACCESS_IP_RANGE (ex: array('127.0.0.1'))
- Set a value to $_REQUEST['warning_msg']
Example of conf/maintenance.inc.php:
// Maintenance mode define('ZBX_DENY_GUI_ACCESS', 0); // IP range, who are allowed to connect to FrontEnd $ZBX_GUI_ACCESS_IP_RANGE = array('127.0.0.1'); // MSG shown on Warning screen! $_REQUEST['warning_msg'] = 'Zabbix is under maintenance.';
When trying to access, the message show is:
$ curl http://zabbix <!DOCTYPE html> <html> ... <body><div class="article"><div class="msg-bad msg-global">Zabbix is under maintenance.<div class="msg-buttons"><button type="button" onclick="document.location.reload();">Retry</button></div></div></div><script type="text/javascript"> setTimeout('document.location.reload();', 30000); </script></body></html> $
It should reply instead, the error in include/config.inc.php:
catch (DBException $e) { (new CView('general.warning', [ 'header' => 'Database error', 'messages' => [$e->getMessage()], 'theme' => ZBX_DEFAULT_THEME ]))->render(); exit; }
If you comment everything in conf/maintenance.inc.php, the problem does not happen and it shows the correct error message:
$ curl http://zabbix <!DOCTYPE html> <html> ... <body><div class="article"><div class="msg-bad msg-global">Database error<div class="msg-details"><ul class="msg-details-border"><li>The frontend does not match Zabbix database. Current database version (mandatory/optional): 2050061/2050061. Required mandatory version: 2050069. Contact your system administrator.</li></ul></div><div class="msg-buttons"><button type="button" onclick="document.location.reload();">Retry</button></div></div></div><script type="text/javascript"> setTimeout('document.location.reload();', 30000); </script></body></html> $