Ad Widget

Collapse

Zabbix 6.0.3 Web interface Install error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mellis
    Senior Member
    • Oct 2017
    • 145

    #1

    Zabbix 6.0.3 Web interface Install error

    Good Afternoon

    I am starting an upgrade / fresh install of a Zabbix 6.0.3 on an ubuntu 20.02 server. i did get the database up and running then the Zabbix Server seems to be happy. But when I got to the web server it seem i cannot connect to the database. All of this is on a single box,, i am connecting to the localhost.

    When i look in the Apache logs i see an error:
    "Trying to access offset on value of type null in usr/share/zabbix/include/classes/core/Cookie Session.php"

    I am running php 7.4.1.

    Anyone have an idea what is wrong.

    I just did this two weeks ago on a Oracle Linux 8.5.x, but my company wanted to go to ubuntu.

    Thanks
  • mellis
    Senior Member
    • Oct 2017
    • 145

    #2
    This is the error message, Am i the only one with this error?
    Attached Files

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      Do you have all the necessary PHP extensions installed, including Ubuntu's PHP extension for connecting to a MySQL database?

      Did the web interface auto-fill "3306" for the port, or did you do that? If you did that, what happens if you change it to 0 (or blank it out completely)? Does that make a difference?

      Comment

      • mellis
        Senior Member
        • Oct 2017
        • 145

        #4

        I installed using the packages sudo apt install zabbix-web-mysql

        I am pretty sure i have all the php extensions, when i review the screen before the database screen it passes all the checks and i check the list at the page in the instructions.
        I made the change to 3306, but was getting the same error with the default 0

        O did notice this morning there is a 6.0.4 out,,, was going to see if i can get what i have update


        Comment

        • mellis
          Senior Member
          • Oct 2017
          • 145

          #5
          I have traced this error down a little more but still have not found a solution, attached is a pic of the apache error log and the code it is pointing to.

          Thanks
          Attached Files

          Comment

          • tim.mooney
            Senior Member
            • Dec 2012
            • 1427

            #6
            Originally posted by mellis
            I am pretty sure i have all the php extensions, when i review the screen before the database screen it passes all the checks and i check the list at the page in the instructions.
            I made the change to 3306, but was getting the same error with the default 0

            O did notice this morning there is a 6.0.4 out,,, was going to see if i can get what i have update
            Starting with 6.0.4 is a good idea, but I don't think it's going to fix this particular issue.

            Keep in mind that when MySQL/MariaDB/Percona is running on the same system as the application (in this case two applications, Zabbix and Zabbix web front end), there are potentially two different ways the application(s) could connect to the database:
            1. by default, the database server listens on a UNIX domain socket, which is a path in the filesystem, probably something like /var/lib/mysql/mysql.sock . Connecting to the database via this socket is typically preferred over option #2, because this type of connection doesn't have to traverse the network stack. This local UNIX domain socket can be disabled and the path to find it can be changed, but in general most vendors would not disable this so it should be available by default.
            2. also by default, the database is probably listening on network port 3306, at least over the localhost network interface. It may or may not be listening on other network interfaces, depending upon default vendor configuration. If you specify that you're connecting to the database over port 3306, you're probably connecting this way.

            If you read the comments in the /etc/zabbix/zabbix_server.conf file for the 'DBHost', 'DBPort', and 'DBSocket', you'll see how you select UNIX socket vs. network for the Zabbix server. That config file is just for zabbix_serverd, though, it's not for the Zabbix web front end.

            Understanding all that, you understand why I asked about the port in the GUI config. I don't think it should be specified, because that may cause the GUI to (attempt to) connect via the network stack, when it would probably be better to have it connect over the UNIX domain socket.

            You may want to use tools like 'netstat' or its modern replacement 'ss' to verify what interface(s) the mysqld is listening on:

            Code:
            $ sudo ss -t -l -p | egrep 'State|mysql'
            State Recv-Q Send-Q Local Address:Port Peer Address:Port
            LISTEN 0 128 [::]:mysql [::]:* users:(("mysqld",pid=2212,fd=22))

            Here's the equivalent to show the UNIX domain socket it's listening on:


            Code:
            $ sudo ss --unix -l -p | egrep 'State|mysql'
            Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
            u_str LISTEN 0 128 /var/lib/mysql/mysql.sock 1658 * 0 users:(("mysqld",pid=2212,fd=23))
            Since you loaded the database schema and initial values on this system, you should have the 'mysql' command present. You can also use that to verify it's possible to connect to the database using the parameters you've specified in the GUI config.

            Comment

            • mellis
              Senior Member
              • Oct 2017
              • 145

              #7
              I was able to make the change to a sock connection for the Zabbix Server, but that did not help the web page,,, i can login the mysql database using the zabbix user. Still looking for a solution
              Attached Files

              Comment

              • mellis
                Senior Member
                • Oct 2017
                • 145

                #8
                I am still looking for a solution for this issue Again i am running a Ubuntu 20.04.3 with PHP 7.4.3, Apache2, and MySQL 8.0.28. The server is running with very little effort. Will i try to run the web interface setup i get to the database page and get a message that I can not connect the database. I can use the zabbix user to connect using the mysql -uzabbix -p command line.

                In the apache error log i find the error message [phyp7:notice] Trying to access array offset on value of type null in /usr/share/zabbix/include/classes/core/CCookieSession.php on line 196.

                That line is in a function isAutologinEnabled():bool

                I run this install on a Oracle Linux 8 and Raspberry PI OS with no issues. I have a requirement by my employer to use the Ubuntu 20.04.

                Comment


                • Rizzyzam
                  Rizzyzam commented
                  Editing a comment
                  Did you get a solution?


                  I am using certificate DB authentication to a remote postgreSQL DB v 13.11. The auth works fine using psql and zabbix server backend connects to the DB without any issues. However, when I try to configure DB on the frontend, I keep getting errors connecting to the DB and httpd log file says "

                  [proxy_fcgi:error].. AH1071: Got error 'PHP message: PHP Warning: Trying to access array offset on value type null in /usr/share/zabbix/include/classes/core/CCookieSession.php on line 194'.

                  it seems to be performing the client side validations but never sends the connections to the backend. I checked the cookie it seems to have all the details that i am passing.

                  Could you please provide your suggestions and comments

                  Version details
                  RHEL9
                  zabbix v 6.4.6
                  ​​httpd - Apache 2.4.53​​​
                  PHP 8.1.14
              Working...