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

Setup with no-existing DB and invalid URL throws PHP fatal error

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 6.0.25, 6.4.10, 7.0.0beta1
    • Frontend (F)

      1. Open Zabbix setup.php.
      2. Make sure you don't have a config file yet. Zabbix UI doesn't know anything about DB at this point.
      3. Type invalid URL. For example /setup.php?next=1.
      4. Observe error in PHP log.

      [11-Jan-2024 16:05:01 Europe/Riga] PHP Notice:  Trying to access array offset on value of type null in C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\classes\db\DB.php on line 212
      [11-Jan-2024 16:05:01 Europe/Riga] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\db.inc.php on line 226
      [11-Jan-2024 16:05:01 Europe/Riga] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\db.inc.php on line 415
      [11-Jan-2024 16:05:01 Europe/Riga] PHP Notice:  Undefined offset: 0 in C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\classes\api\services\CSettings.php on line 125
      [11-Jan-2024 16:05:01 Europe/Riga] PHP Fatal error:  Uncaught TypeError: Return value of CSettings::getGlobal() must be of the type array, null returned in C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\classes\api\services\CSettings.php:125
      Stack trace:
      #0 C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\classes\helpers\CSettingsHelper.php(104): CSettings->getGlobal(Array, false)
      #1 C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\classes\helpers\CSettingsHelper.php(127): CSettingsHelper::loadParams('x_frame_options', true)
      #2 C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\page_header.php(105): CSettingsHelper::getGlobal('x_frame_options')
      #3 C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\validate.inc.php(405): require_once('C:\\Development\\...')
      #4 C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\validate.inc.php(465): invalid_url()
      #5 C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\setup.php(72): check_fields(NULL, false)
      #6 {main}
        thrown in C:\Development\zabbix-src\feature\ZBX-23567-6.0\ui\include\classes\api\services\CSettings.php on line 125
      

      We are trying to get settings (configuration parameters), but we don't have access to DB yet. Solution is to be discussed.

            zabbix.dev Zabbix Development Team
            iivs Ivo Kurzemnieks
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: