Ad Widget

Collapse

Zabbix 5.0.1 > DB type "MYSQL" is not supported by current setup.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coudy
    Junior Member
    • Mar 2012
    • 17

    #1

    Zabbix 5.0.1 > DB type "MYSQL" is not supported by current setup.

    Hi, after long time, I've upgraded my installation from Zabbix 4.x version to 5.0. I had some problem with backend, so I had to manually patch zabbix database , but now server and agentd are running. I have problem with my frontend. I still see this error: "DB type "MYSQL" is not supported by current setup."

    I'm running my server on debian bullseye/sid with installed mariadb. I have tried uninstall everything and install from repository according to docs but I can't get rid of that error.

    I have this packages installed:
    packages:
    Code:
    root@nas:/tmp# dpkg -l "mysql*" | grep "ii "
    ii mysql-common 5.8+1.0.5 all MySQL database common files, e.g. /etc/mysql/my.cnf
    
    root@nas:/tmp# dpkg -l "maria*" | grep "ii "
    ii mariadb-client-10.3 1:10.3.22-1 amd64 MariaDB database client binaries
    ii mariadb-client-core-10.3 1:10.3.22-1 amd64 MariaDB database core client binaries
    ii mariadb-common 1:10.3.22-1 all MariaDB common metapackage
    ii mariadb-server-10.3 1:10.3.22-1 amd64 MariaDB database server binaries
    ii mariadb-server-core-10.3 1:10.3.22-1 amd64 MariaDB database core server files
    
    root@nas:/tmp# dpkg -l "zabbix*" | grep "ii "
    ii zabbix-agent 1:5.0.1+dfsg-1 amd64 network monitoring solution - agent
    ii zabbix-frontend-php 1:5.0.1+dfsg-1 all network monitoring solution - PHP front-end
    ii zabbix-nginx-conf 1:5.0.1-1+buster all Zabbix network monitoring solution - nginx and php-fpm configuration for front-end
    ii zabbix-release 1:5.0-1+buster all Zabbix official repository configuration
    ii zabbix-server-mysql 1:5.0.1+dfsg-1 amd64 network monitoring solution - server (using MySQL)
    configs:
    zabbix_server:
    Code:
    root@nas:/etc/zabbix# grep DB zabbix_server.conf
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=<password>
    DBSocket=/var/run/mysqld/mysqld.sock
    zabbix.conf.php
    Code:
    <?php
    // Zabbix GUI configuration file.
    global $DB;
    
    $DB['TYPE'] = 'MYSQL';
    $DB['SERVER'] = 'localhost';
    $DB['PORT'] = '0';
    $DB['DATABASE'] = 'zabbix';
    $DB['USER'] = 'zabbix';
    $DB['PASSWORD'] = '<password>';
    
    // Schema name. Used for IBM DB2 and PostgreSQL.
    $DB['SCHEMA'] = '';
    
    // Used for TLS connection.
    $DB['ENCRYPTION'] = false;
    $DB['KEY_FILE'] = '';
    $DB['CERT_FILE'] = '';
    $DB['CA_FILE'] = '';
    $DB['VERIFY_HOST'] = false;
    $DB['CIPHER_LIST'] = '';
    
    
    $ZBX_SERVER = 'localhost';
    $ZBX_SERVER_PORT = '10051';
    $ZBX_SERVER_NAME = '';
    
    $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
    
    // Uncomment this block only if you are using Elasticsearch.
    // Elasticsearch url (can be string if same url is used for all types).
    //$HISTORY['url'] = [
    // 'uint' => 'http://localhost:9200',
    // 'text' => 'http://localhost:9200'
    //];
    // Value types stored in Elasticsearch.
    //$HISTORY['types'] = ['uint', 'text'];
    
    // Used for SAML authentication.
    // Uncomment to override the default paths to SP private key, SP and IdP X.509 certificates, and to set extra settings.
    //$SSO['SP_KEY'] = 'conf/certs/sp.key';
    //$SSO['SP_CERT'] = 'conf/certs/sp.crt';
    //$SSO['IDP_CERT'] = 'conf/certs/idp.crt';
    //$SSO['SETTINGS'] = [];
    
    ?>
    My database and server are running:
    Mysql(MariaDB)
    Code:
    root@nas:/tmp# mysql --version
    mysql Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
    Code:
    root@nas:/tmp# systemctl status zabbix-server
    ● zabbix-server.service - Zabbix Server (MySQL/MariaDB)
    Loaded: loaded (/lib/systemd/system/zabbix-server.service; enabled; vendor preset: enabled)
    Active: active (running) since Mon 2020-06-15 17:13:36 CEST; 13min ago
    Docs: man:zabbix_server
    Main PID: 2264296 (zabbix_server)
    Tasks: 68 (limit: 19032)
    Memory: 235.4M
    CGroup: /system.slice/zabbix-server.service
    ├─2264296 /usr/sbin/zabbix_server --foreground
    ├─2264297 /usr/sbin/zabbix_server: configuration syncer [synced configuration in 0.071506 sec, idle 60 sec]
    ├─2264298 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
    ├─2264299 /usr/sbin/zabbix_server: timer #1 [updated 0 hosts, suppressed 0 events in 0.000806 sec, idle 59 sec]
    ├─2264300 /usr/sbin/zabbix_server: http poller #1 [got 0 values in 0.000412 sec, idle 5 sec]
    ├─2264301 /usr/sbin/zabbix_server: discoverer #1 [processed 0 rules in 0.000000 sec, performing discovery]
    ├─2264302 /usr/sbin/zabbix_server: history syncer #1 [processed 0 values, 0 triggers in 0.000023 sec, idle 1 sec]
    ├─2264303 /usr/sbin/zabbix_server: history syncer #2 [processed 8 values, 2 triggers in 0.033607 sec, idle 1 sec]
    ├─2264304 /usr/sbin/zabbix_server: history syncer #3 [processed 0 values, 0 triggers in 0.000025 sec, idle 1 sec]
    ├─2264305 /usr/sbin/zabbix_server: history syncer #4 [processed 0 values, 0 triggers in 0.000030 sec, idle 1 sec]
    ├─2264306 /usr/sbin/zabbix_server: escalator #1 [processed 0 escalations in 0.001198 sec, idle 3 sec]
    ├─2264307 /usr/sbin/zabbix_server: proxy poller #1 [exchanged data with 0 proxies in 0.000014 sec, idle 5 sec]
    ├─2264308 /usr/sbin/zabbix_server: self-monitoring [processed data in 0.000013 sec, idle 1 sec]
    ├─2264309 /usr/sbin/zabbix_server: task manager [processed 0 task(s) in 0.000231 sec, idle 5 sec]
    ├─2264310 /usr/sbin/zabbix_server: poller #1 [got 0 values in 0.000007 sec, idle 1 sec]
    ├─2264311 /usr/sbin/zabbix_server: poller #2 [got 0 values in 0.000013 sec, idle 1 sec]
    ├─2264312 /usr/sbin/zabbix_server: poller #3 [got 0 values in 0.000019 sec, idle 1 sec]
    ├─2264313 /usr/sbin/zabbix_server: poller #4 [got 0 values in 0.000014 sec, idle 1 sec]
    ├─2264314 /usr/sbin/zabbix_server: poller #5 [got 0 values in 0.000024 sec, idle 1 sec]
    ├─2264315 /usr/sbin/zabbix_server: poller #6 [got 0 values in 0.000007 sec, idle 1 sec]
    ├─2264316 /usr/sbin/zabbix_server: poller #7 [got 0 values in 0.000008 sec, idle 1 sec]
    ├─2264317 /usr/sbin/zabbix_server: poller #8 [got 0 values in 0.000024 sec, idle 1 sec]
    ├─2264318 /usr/sbin/zabbix_server: poller #9 [got 0 values in 0.000007 sec, idle 1 sec]
    ├─2264319 /usr/sbin/zabbix_server: poller #10 [got 0 values in 0.000027 sec, idle 1 sec]
    ├─2264320 /usr/sbin/zabbix_server: poller #11 [got 0 values in 0.000008 sec, idle 1 sec]
    ├─2264321 /usr/sbin/zabbix_server: poller #12 [got 0 values in 0.000008 sec, idle 1 sec]
    ├─2264322 /usr/sbin/zabbix_server: poller #13 [got 0 values in 0.000008 sec, idle 1 sec]
    ├─2264323 /usr/sbin/zabbix_server: poller #14 [got 0 values in 0.000014 sec, idle 1 sec]
    ├─2264324 /usr/sbin/zabbix_server: poller #15 [got 0 values in 0.000009 sec, idle 1 sec]
    ├─2264325 /usr/sbin/zabbix_server: poller #16 [got 0 values in 0.000007 sec, idle 1 sec]
    ├─2264326 /usr/sbin/zabbix_server: poller #17 [got 0 values in 0.000017 sec, idle 1 sec]
    ├─2264327 /usr/sbin/zabbix_server: poller #18 [got 0 values in 0.000022 sec, idle 1 sec]
    ├─2264328 /usr/sbin/zabbix_server: poller #19 [got 0 values in 0.000008 sec, idle 1 sec]
    ├─2264329 /usr/sbin/zabbix_server: poller #20 [got 0 values in 0.000007 sec, idle 1 sec]
    ├─2264330 /usr/sbin/zabbix_server: poller #21 [got 0 values in 0.000007 sec, idle 1 sec]
    ├─2264331 /usr/sbin/zabbix_server: poller #22 [got 0 values in 0.000008 sec, idle 1 sec]
    ├─2264332 /usr/sbin/zabbix_server: poller #23 [got 10 values in 3.000377 sec, idle 1 sec]
    ├─2264333 /usr/sbin/zabbix_server: poller #24 [got 0 values in 0.000025 sec, idle 1 sec]
    ├─2264334 /usr/sbin/zabbix_server: poller #25 [got 0 values in 0.000022 sec, getting values]
    ├─2264335 /usr/sbin/zabbix_server: poller #26 [got 0 values in 0.000027 sec, idle 1 sec]
    ├─2264336 /usr/sbin/zabbix_server: poller #27 [got 0 values in 0.000013 sec, idle 1 sec]
    ├─2264337 /usr/sbin/zabbix_server: poller #28 [got 0 values in 0.000016 sec, idle 1 sec]
    ├─2264338 /usr/sbin/zabbix_server: poller #29 [got 0 values in 0.000014 sec, idle 1 sec]
    ├─2264340 /usr/sbin/zabbix_server: poller #30 [got 0 values in 0.000028 sec, idle 1 sec]
    ├─2264341 /usr/sbin/zabbix_server: unreachable poller #1 [got 0 values in 0.000026 sec, idle 5 sec]
    ├─2264342 /usr/sbin/zabbix_server: unreachable poller #2 [got 0 values in 0.000015 sec, idle 5 sec]
    ├─2264343 /usr/sbin/zabbix_server: unreachable poller #3 [got 0 values in 0.000019 sec, idle 5 sec]
    ├─2264344 /usr/sbin/zabbix_server: trapper #1 [processed data in 0.000240 sec, waiting for connection]
    ├─2264345 /usr/sbin/zabbix_server: trapper #2 [processed data in 0.000135 sec, waiting for connection]
    ├─2264346 /usr/sbin/zabbix_server: icmp pinger #1 [pinging hosts]
    ├─2264347 /usr/sbin/zabbix_server: icmp pinger #2 [got 0 values in 0.000025 sec, idle 5 sec]
    ├─2264349 /usr/sbin/zabbix_server: icmp pinger #3 [got 1 values in 9.010999 sec, idle 5 sec]
    ├─2264350 /usr/sbin/zabbix_server: alert manager #1 [sent 0, failed 0 alerts, idle 5.002323 sec during 5.002401 sec]
    ├─2264351 /usr/sbin/zabbix_server: alerter #1 started
    ├─2264352 /usr/sbin/zabbix_server: alerter #2 started
    ├─2264353 /usr/sbin/zabbix_server: alerter #3 started
    ├─2264354 /usr/sbin/zabbix_server: preprocessing manager #1 [queued 0, processed 294 values, idle 5.176911 sec during 5.177788 sec]
    ├─2264378 /usr/sbin/zabbix_server: preprocessing worker #1 started
    ├─2264379 /usr/sbin/zabbix_server: preprocessing worker #2 started
    ├─2264380 /usr/sbin/zabbix_server: preprocessing worker #3 started
    ├─2264381 /usr/sbin/zabbix_server: lld manager #1 [processed 0 LLD rules during 5.021573 sec]
    ├─2264382 /usr/sbin/zabbix_server: lld worker #1 started
    ├─2264383 /usr/sbin/zabbix_server: lld worker #2 started
    ├─2264385 /usr/sbin/zabbix_server: alert syncer [queued 0 alerts(s), flushed 0 result(s) in 0.000314 sec, idle 1 sec]
    ├─2269803 sh -c /usr/bin/fping -C3 -i0 2>&1 </tmp/zabbix_server_2264301.pinger;
    ├─2269804 /usr/bin/fping -C3 -i0
    ├─2269822 sh -c /usr/bin/fping -C5 -i0 2>&1 </tmp/zabbix_server_2264346.pinger;
    └─2269823 /usr/bin/fping -C5 -i0

    Any help ?

    Thank You.
  • coudy
    Junior Member
    • Mar 2012
    • 17

    #2
    Any help ?

    I have php-mysql installed, so I don't know what is wrong.

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      Originally posted by coudy
      I had some problem with backend, so I had to manually patch zabbix database
      So that part is pretty vague, but it's also possibly relevant for the problem you're facing. When asking for help, you're more likely to get a response if you provide all the information that might be needed to zero in on the problem.

      You've said you have php-mysql installed, but the error message you posted (which is coming from ui/include/classes/core/CConfigFile.php only happens if 'getSupportedDatabases()' doesn't include 'MySQL'. Since your error message doesn't also say "Possible values" with some list of possible DB types, you have no supported databases.

      Looking at getSupportedDatabases() (ui/include/classes/setup/CFrontendSetup.php), it will only include MySQL in the list if all of these PHP functions are callable:

      'mysqli_close', 'mysqli_connect', 'mysqli_connect_error', 'mysqli_error', 'mysqli_fetch_assoc', 'mysqli_free_result', 'mysqli_query', 'mysqli_real_escape_string'

      That implies that either your php-mysql isn't actually present or isn't getting loaded or it's missing one or more of these functions.

      What happens if you browse to your server's /zabbix/setup.php as if you were going to do a new install of Zabbix, and then review the "Check of pre-requisites"? Does that find MySQL?

      Comment

      • coudy
        Junior Member
        • Mar 2012
        • 17

        #4
        I had some error during upgrade database, so I solved it manually, some columns, indexes etc, didn't exist in tables, so I've created them manually. After that, upgrade finished, and server started.

        My version of php-mysql is:

        Code:
        Desired=Unknown/Install/Remove/Purge/Hold
        | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
        |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
        ||/ Name Version Architecture Description
        +++-==============-============-============-=================================
        ii php-mysql 2:7.3+69 all MySQL module for PHP [default]
        This is output from php version:

        Click image for larger version  Name:	ApEFbO3.png Views:	0 Size:	9.3 KB ID:	403617

        When I launch setup.php, I see setup wizard,

        Click image for larger version  Name:	BTPFpWW.png Views:	0 Size:	27.9 KB ID:	403618

        but after NEXT STEP, page is blank, and errors 500 in setup.php:

        Click image for larger version  Name:	oNtxaDR.png Views:	0 Size:	66.6 KB ID:	403619

        and I've found this in error.log

        Code:
        2020/06/18 20:34:50 [error] 2723967#2723967: *33884 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function ctype_digit() in /usr/share/zabbix/include/func.inc.
        php:442
        Stack trace:
        #0 /usr/share/zabbix/include/classes/setup/CFrontendSetup.php(117): str2mem('128M')
        #1 /usr/share/zabbix/include/classes/setup/CFrontendSetup.php(62): CFrontendSetup->checkPhpMemoryLimit()
        #2 /usr/share/zabbix/include/classes/setup/CSetupWizard.php(168): CFrontendSetup->checkRequirements()
        #3 /usr/share/zabbix/include/classes/setup/CSetupWizard.php(150): CSetupWizard->stage1()
        #4 /usr/share/zabbix/include/classes/setup/CSetupWizard.php(101): CSetupWizard->getStage()
        #5 /usr/share/zabbix/include/classes/html/CTag.php(97): CSetupWizard->bodyToString()
        #6 /usr/share/zabbix/include/classes/html/CObject.php(89): CTag->toString(false)
        #7 /usr/share/zabbix/include/classes/html/CObject.php(66): unpack_object(Object(CSetupWizard))
        #8 /usr/share/zabbix/include/classes/html/CTag.php(117): CObject->addItem(Object(CSetupWizard))
        #9 /usr/share/zabbix/include/classes/" while reading response header from upstream, client: 192.168.2.1, server: localhost, request: "POST /zabbix/setup.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/
        php/zabbix.sock:", host: "<host>", referrer: "http://<host>/zabbix/setup.php"
        Last edited by coudy; 18-06-2020, 20:44.

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #5
          Does Debian separate the PHP ctype code into a separate package? It would probably be called something like 'php-ctype' or similar. If it does, you need to install that too.

          Comment

          • coudy
            Junior Member
            • Mar 2012
            • 17

            #6
            I've checked that. Ctype is in php-commom, and I've that package installed.

            Code:
            root@nas:~# LC_ALL=C apt-cache search ctype | grep php
            php7.3-common - documentation, examples and common module for PHP
            php7.4-common - documentation, examples and common module for PHP
            php-symfony-polyfill-ctype - Symfony polyfill for ctype functions
            
            root@nas:~# LC_ALL=C apt install php7.3-common
            Reading package lists... Done
            Building dependency tree
            Reading state information... Done
            php7.3-common is already the newest version (7.3.15-3).
            php7.3-common set to manually installed.
            0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.
            root@nas:~#
            And loaded in modules too
            Click image for larger version

Name:	SmartSelect_20200618-221118_Firefox.jpg
Views:	8985
Size:	313.8 KB
ID:	403630

            Comment

            • coudy
              Junior Member
              • Mar 2012
              • 17

              #7
              I've played little with ctype_digit() function, and discovered, that it does not work globally. So I've uninstalled and installed php-common, php7.3-common zabbix-nginx-conf and after that, frontend is working again.

              How to close this thread and mark it as solved ?

              Comment

              Working...