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

v6.0.22 install fails DB connect @ install, error: "Trying to access array offset on value of type null in .../CCookieSession.php"

XMLWordPrintable

    • Sprint 106 (Nov 2023), Sprint 107 (Dec 2023), S2401, S24-W10/11
    • 1

      on

      	lsb_release -rd
      		Description:    Fedora release 38 (Thirty Eight)
      		Release:        38
      
      	rpm -qa zabbix\* | sort
      		zabbix-6.0.22-1.fc38.x86_64
      		zabbix-agent-6.0.22-1.fc38.x86_64
      		zabbix-dbfiles-mysql-6.0.22-1.fc38.noarch
      		zabbix-proxy-6.0.22-1.fc38.noarch
      		zabbix-proxy-mysql-6.0.22-1.fc38.x86_64
      		zabbix-selinux-6.0.22-1.fc38.noarch
      		zabbix-server-6.0.22-1.fc38.noarch
      		zabbix-server-mysql-6.0.22-1.fc38.x86_64
      		zabbix-web-6.0.22-1.fc38.noarch
      		zabbix-web-mysql-6.0.22-1.fc38.noarch
      

      with

      	php -v
      		PHP 8.2.11 (cli) (built: Sep 26 2023 11:11:58) (NTS gcc x86_64)
      		Copyright (c) The PHP Group
      	Zend Engine v4.2.11, Copyright (c) Zend Technologies
      		with Zend OPcache v8.2.11, Copyright (c), by Zend Technologies
      		with Xdebug v3.2.2, Copyright (c) 2002-2023, by Derick Rethans
      
      	mariadb -V
      		/usr/bin/mariadb  Ver 15.1 Distrib 10.11.5-MariaDB, for Linux (x86_64) using  EditLine wrapper
      

      i've setup/launched zabbix server & proxy,

      zabbix_server -V
          zabbix_server (Zabbix) 6.0.22
          Revision 2b0090fc371 25 September 2023, compilation time: Oct  4 2023 00:00:00
          ...
      
      zabbix_proxy -V
          zabbix_proxy (Zabbix) 6.0.22
          Revision 2b0090fc371 25 September 2023, compilation time: Oct  4 2023 00:00:00
          ...
      
      systemctl status zabbix-server zabbix-proxy -n0
          ● zabbix-server.service - zabbix
               Loaded: loaded (/etc/systemd/system/zabbix-server.service; enabled; preset: disabled)
              Drop-In: /usr/lib/systemd/system/service.d
                       └─10-timeout-abort.conf
               Active: active (running) since Tue 2023-10-17 16:31:13 EDT; 3s ago
              Process: 24411 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
             Main PID: 24413 (zabbix_server)
                Tasks: 1 (limit: 9830)
               Memory: 2.3M
                  CPU: 9ms
               CGroup: /system.slice/zabbix-server.service
                       └─24413 /usr/sbin/zabbix_server -c /usr/local/etc/zabbix/zabbix_server.conf
      
          ● zabbix-proxy.service - zabbix-proxy
               Loaded: loaded (/etc/systemd/system/zabbix-proxy.service; enabled; preset: disabled)
              Drop-In: /usr/lib/systemd/system/service.d
                       └─10-timeout-abort.conf
               Active: active (running) since Tue 2023-10-17 16:31:14 EDT; 3s ago
              Process: 24417 ExecStart=/usr/sbin/zabbix_proxy -c $CONFFILE (code=exited, status=0/SUCCESS)
             Main PID: 24419 (zabbix_proxy)
                Tasks: 1 (limit: 9830)
               Memory: 2.5M
                  CPU: 9ms
               CGroup: /system.slice/zabbix-proxy.service
                       └─24419 /usr/sbin/zabbix_proxy -c /usr/local/etc/zabbix/zabbix_proxy.conf
      

      where

      id zabbix zabbixsrv wwwrun
          uid=970(zabbix) gid=962(zabbix) groups=962(zabbix)
          uid=972(zabbixsrv) gid=964(zabbixsrv) groups=964(zabbixsrv),984(www)
      

      db config's consistent

      grep ^DB /usr/local/etc/zabbix/zabbix*conf
          /usr/local/etc/zabbix/zabbix_proxy.conf:DBName=zabbix_proxy
          /usr/local/etc/zabbix/zabbix_proxy.conf:DBHost=localhost
          /usr/local/etc/zabbix/zabbix_proxy.conf:DBSocket='/run/mariadb/mariadb.sock'
          /usr/local/etc/zabbix/zabbix_proxy.conf:DBUser='zabbix_user
          /usr/local/etc/zabbix/zabbix_proxy.conf:DBPassword='ABcfEFGH-iJKLMm-oPQ12Rst'
          /usr/local/etc/zabbix/zabbix_server.conf:DBName=zabbix
          /usr/local/etc/zabbix/zabbix_server.conf:DBHost=localhost
          /usr/local/etc/zabbix/zabbix_server.conf:DBSocket='/run/mariadb/mariadb.sock'
          /usr/local/etc/zabbix/zabbix_server.conf:DBUser='zabbix_user
          /usr/local/etc/zabbix/zabbix_server.conf:DBPassword='ABcfEFGH-iJKLMm-oPQ12Rst'
      
      ls -al /usr/share/zabbix/etc/zabbix/web/zabbix.conf.php
          lrwxrwxrwx 1 wwwrun www 37 Oct 17 15:35 /usr/share/zabbix/etc/zabbix/web/zabbix.conf.php -> /usr/local/etc/zabbix/zabbix.conf.php
      
      cat /usr/share/zabbix/etc/zabbix/web/zabbix.conf.php
          <?php
      
          global $DB;
      
          $DB['TYPE']           = 'MYSQL';
          $DB['SERVER']         = 'localhost:/run/mariadb/mariadb.sock';
          $DB['PORT']           = '0';
          $DB['DATABASE']       = 'zabbix';
          $DB['USER']           = 'zabbix_user;
          $DB['PASSWORD']       = 'ABcfEFGH-iJKLMm-oPQ12Rst';
          $DB['ENCRYPTION']     = 'false';
          $DB['VERIFY_HOST']    = 'false';
          $ZBX_SERVER           = 'zabbix-server.example.com';
          $ZBX_SERVER_PORT      = '10052';
          $ZBX_SERVER_NAME      = 'Zabbix Server';
          $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
          ?>
      

      testing db connection from local shell works

      sudo -u zabbixsrv 
      mariadb 
       --user=&#39;zabbix_user 
       --password=&#39;ABcfEFGH-iJKLMm-oPQ12Rst&#39; 
       --host=localhost 
       --protocol=socket 
       --socket=/run/mariadb/mariadb.sock 
       --execute=&quot;SHOW DATABASES;&quot;
          +--------------------+
          | Database           |
          +--------------------+
          | information_schema |
          | zabbix             |
          | zabbix_proxy       |
          +--------------------+
      
      

      at nav to

      https://zabbix.example.com

      'Welcome' and 'Check of pre-requisites' are OK

      at next redirect to

      -> https://zabbix.example.com/setup.php

          Configure DB connection
      
          Please create database manually, and set the configuration parameters for connection to this database. Press "Next step" button when done.
      
          Database type:	MYSQL
      
          Database host:	localhost:/run/mariadb/mariadb.sock
          Database port:	0
          Database name:	zabbix
          Store credentials in:	Plain text
          User:	zabbix_user
          Password:	ABcfEFGH-iJKLMm-oPQ12Rst
          Database TLS encryption: [ ]
      

      fails with,

      Details Cannot connect to the database.
      
          No such file or directory
      

      and in logs

      ==&gt; /var/log/nginx/php-fpm-[www.log|http://www.log] &lt;==
      [17-Oct-2023 16:44:51 America/New_York] PHP Warning:  Trying to access array offset on value of type null in /usr/share/zabbix/include/classes/core/CCookieSession.php on line 194
      [17-Oct-2023 16:44:51 America/New_York] PHP Stack trace:
      [17-Oct-2023 16:44:51 America/New_York] PHP   1. {main}() /usr/share/zabbix/setup.php:0
      [17-Oct-2023 16:44:51 America/New_York] PHP   2. session_write_close() /usr/share/zabbix/setup.php:193
      [17-Oct-2023 16:44:51 America/New_York] PHP   3. CCookieSession-&gt;write($id = &#39;5c38685f8ae0b5998e57f11cb04bb8e4&#39;, $data = &#39;sessionid|s:32:&quot;5c38685f8ae0b5998e57f11cb04bb8e4&quot;;check_fields_result|b:1;default_lang|s:5:&quot;en_US&quot;;default_timezone|s:6:&quot;system&quot;;default_theme|s:10:&quot;blue-theme&quot;;step|i:3;DB_TYPE|s:5:&quot;MYSQL&quot;;DB_SERVER|s:9:&quot;localhost&quot;;DB_PORT|s:1:&quot;0&quot;;DB_DATABASE|s:6:&quot;zabbix&quot;;DB_USER|s:19:&quot;zabbix_user&quot;;DB_PASSWORD|s:26:&quot;&#39;ABcfEFGH-iJKLMm-oPQ12Rst&#39;&quot;;DB_SCHEMA|s:0:&quot;&quot;;DB_ENCRYPTION|b:0;DB_ENCRYPTION_ADVANCED|b:0;DB_VERIFY_HOST|b:0;DB_KEY_FILE|s:0:&quot;&quot;;DB_CERT_FILE|s:0:&quot;&quot;;DB_CA_FILE|s:0:&quot;&quot;;DB_CIPHER_LIST|s:0:&quot;&quot;;DB_CREDS_STORA&#39;...) /usr/share/zabbix/setup.php:193
      [17-Oct-2023 16:44:51 America/New_York] PHP   4. CCookieSession-&gt;isAutologinEnabled() /usr/share/zabbix/include/classes/core/CCookieSession.php:127
      
      

            Miks.Kronkalns Miks Kronkalns
            pgnd _
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: