Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19992

critical PHP error on v5.4 if Guest user is missing in DB.

    XMLWordPrintable

Details

    • Incident report
    • Status: Confirmed
    • Trivial
    • Resolution: Unresolved
    • 5.4.4
    • None
    • Frontend (F)
    • None

    Description

      [Mon Sep 20 14:49:50.977725 2021] [php7:notice] [pid 3225805] [client 172.31.4.41:55304] PHP Notice:  Undefined offset: 0 in /usr/share/zabbix/include/classes/user/CWebUser.php on line 211, referer: http://192.168.221.202/zabbix/hosts.php
      
      [Mon Sep 20 14:49:50.977762 2021] [php7:notice] [pid 3225805] [client 172.31.4.41:55304] PHP Notice:  Trying to access array offset on value of type null in /usr/share/zabbix/include/classes/user/CWebUser.php on line 211, referer: http://192.168.221.202/zabbix/hosts.php
      
      [Mon Sep 20 14:49:50.978147 2021] [php7:notice] [pid 3225805] [client 172.31.4.41:55304] PHP Notice:  Undefined offset: 0 in /usr/share/zabbix/include/classes/user/CWebUser.php on line 212, referer: http://192.168.221.202/zabbix/hosts.php
      
      [Mon Sep 20 14:49:50.978166 2021] [php7:notice] [pid 3225805] [client 172.31.4.41:55304] PHP Notice:  Trying to access array offset on value of type null in /usr/share/zabbix/include/classes/user/CWebUser.php on line 212, referer: http://192.168.221.202/zabbix/hosts.php
      
      [Mon Sep 20 14:49:50.978193 2021] [php7:error] [pid 3225805] [client 172.31.4.41:55304] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to getUserGuiAccess() must be of the type string, null given, called in /usr/share/zabbix/include/classes/user/CWebUser.php on line 212 and defined in /usr/share/zabbix/include/perm.inc.php:98\nStack trace:\n#0 /usr/share/zabbix/include/classes/user/CWebUser.php(212): getUserGuiAccess()\n#1 /usr/share/zabbix/index.php(100): CWebUser::isGuestAllowed()\n#2 {main}\n  thrown in /usr/share/zabbix/include/perm.inc.php on line 98, referer: http://192.168.221.202/zabbix/hosts.php
      

      I think that this error on PHP level should not happen, as it causes HTTP code 500 and complicates troubleshooting for users .

      Instead some nice message should be displayed.

      Missing Guest was not an issue in 4.4, issue appeared right after upgrade. That's one more reason why it's better to avoid such PHP error as it pushes zabbix users to think about upgrade procedure issue, while it's not really related to upgrade itself.

      Attachments

        Activity

          People

            zabbix.dev Zabbix Development Team
            zalex_ua Oleksii Zagorskyi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: