Ad Widget

Collapse

webui DB install fails:"... array offset on value of type null in CCookieSession.php"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pgnd
    Junior Member
    • Oct 2023
    • 2

    #1

    webui DB install fails:"... array offset on value of type null in CCookieSession.php"

    I'm new-installing Zabbix Server & Proxy + MariaDB on Fedora 38.

    server & proxy launch, and connect to DB fine, from shell

    @ webui config, the DB connect -- using same credentials -- fails.

    searching online, i'm not clear whether this is self-inflicted, or a bug :-/

    suggestions/hints?

    Code:
    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='zabbix_user \
     --password='ABcfEFGH-iJKLMm-oPQ12Rst' \
     --host=localhost \
     --protocol=socket \
     --socket=/run/mariadb/mariadb.sock \
     --execute="SHOW DATABASES;"
        +--------------------+
        | Database           |
        +--------------------+
        | information_schema |
        | zabbix             |
        | zabbix_proxy       |
        +--------------------+
    
    
    at nav to
    
        https://zabbix.example.com
    
    'Welcome' and 'Chec 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
    
    ==> /var/log/nginx/php-fpm-www.log <==
    [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->write($id = '5c38685f8ae0b5998e57f11cb04bb8e4', $data = 'sessionid|s:32:"5c38685f8ae0b5998e57f11cb04bb8e4";check_fields_result|b:1;default_lang|s:5:"en_US";default_timezone|s:6:"system";default_theme|s:10:"blue-theme";step|i:3;DB_TYPE|s:5:"MYSQL";DB_SERVER|s:9:"localhost";DB_PORT|s:1:"0";DB_DATABASE|s:6:"zabbix";DB_USER|s:19:"zabbix_user";DB_PASSWORD|s:26:"\'ABcfEFGH-iJKLMm-oPQ12Rst\'";DB_SCHEMA|s:0:"";DB_ENCRYPTION|b:0;DB_ENCRYPTION_ADVANCED|b:0;DB_VERIFY_HOST|b:0;DB_KEY_FILE|s:0:"";DB_CERT_FILE|s:0:"";DB_CA_FILE|s:0:"";DB_CIPHER_LIST|s:0:"";DB_CREDS_STORA'...) /usr/share/zabbix/setup.php:193
    [17-Oct-2023 16:44:51 America/New_York] PHP   4. CCookieSession->isAutologinEnabled() /usr/share/zabbix/include/classes/core/CCookieSession.php:127
  • pgnd
    Junior Member
    • Oct 2023
    • 2

    #2
    confirmed as bug -> https://support.zabbix.com/browse/ZBX-23567

    Comment

    Working...