Ad Widget

Collapse

Cant get past db setup for Zabbix 6.4 w/Postgres on ubuntu 22.04

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbw
    Junior Member
    • Oct 2022
    • 4

    #1

    Cant get past db setup for Zabbix 6.4 w/Postgres on ubuntu 22.04

    Hi,
    I had a zabbix 6.2 instance running on Ubuntu 22.04 with Postgres

    something got tangled up with php on this machine and I have uninstalled everything and reinstalled zabbix according to the guide here:
    https://www.zabbix.com/download?zabb...ubuntu&os_vers ion=22.04&components=server_frontend_agent&db=pgsq l&ws=apache

    Its notable that the URL /zabbix first screen for 6.4 still says "Zabbix 5.0" - not sure if that is a bug


    Im trying to follow the guide for installing zabbix 6.4 on ubuntu 22.04 but I get errors once I put the postgres database information & pw in to the setup form
    I see these errors:

    Details Cannot connect to the database.
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:100 → CSetupWizard->__construct() → CSetupWizard->eventHandler() → CSetupWizard->dbConnect() → DBconnect() → PostgresqlDbBackend->init() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:902]
    • pg_parameter_status(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:100 → CSetupWizard->__construct() → CSetupWizard->eventHandler() → CSetupWizard->dbConnect() → DBconnect() → PostgresqlDbBackend->init() → pg_parameter_status() in include/classes/db/PostgresqlDbBackend.php:249]
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:100 → CSetupWizard->__construct() → CSetupWizard->eventHandler() → CSetupWizard->dbConnect() → DBconnect() → PostgresqlDbBackend->isConnectionSecure() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:902]
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:100 → CSetupWizard->__construct() → CSetupWizard->eventHandler() → CSetupWizard->dbConnect() → DBconnect() → DbBackend->checkDbVersion() → PostgresqlDbBackend->checkDbVersionTable() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:902]
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:100 → CSetupWizard->__construct() → CSetupWizard->eventHandler() → CSetupWizard->dbConnect() → DBconnect() → DbBackend->checkDbVersion() → PostgresqlDbBackend->checkDbVersionTable() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:902]
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:100 → CSetupWizard->__construct() → CSetupWizard->eventHandler() → CSetupWizard->dbConnect() → DBconnect() → DbBackend->checkDbVersion() → PostgresqlDbBackend->checkDbVersionTable() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:902]
    • The Zabbix database version does not match current requirements. Your database version: 6040000. Required version: 5000000. Please contact your system administrator.
    • substr(): Passing null to parameter #1 ($string) of type string is deprecated [setup.php:108 → CPageHeader->__construct() → substr() in include/classes/html/pageheader/CPageHeader.php:67]

    It looks like I have php8.1



    Questions:

    1) Any thoughts how to get past this error?

    2) Did I need to do anything to "transform the postgres DB" from 6.2 to 6.4 ? Is there some upgrade of the database needed?

    3) Is the postgres database for Zabbix used for just the web front end or is the zabbix server storing long term data in there as well?

    4) If we lost that postgres database, what would be the impact? Would we have to recreate all the zabbix alerts and rules and tests ?


    thanks for the assist & great project- thank you !



    Matt
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    "Your database version: 6040000. Required version: 5000000. Please contact your system administrator."

    It thinks you need to downgrade... so there is definitely some component with wrong version installed... Probably frontend, as you say it also mentions 5.0 somewhere...

    If there would be 6.2 DB waiting, you would not get "Your database version: 6040000..." but probably 6020000 or similar...
    If you kept your old DB, then you should not run any DB creation scripts (I suspect you did that??) . Just running your 6.4 server pointed to 6.2 DB should upgrade all DB related things so you would get proper 6.4.

    Comment

    • mbw
      Junior Member
      • Oct 2022
      • 4

      #3
      There is definitely something wrong with the apt sources for zabbix 6.4

      When I install zabbix-frontend-php - I get version 5, despite having the zabbix64 release installed

      root@ika:~# apt remove zabbix-frontend-php
      Reading package lists... Done
      Building dependency tree... Done
      Reading state information... Done
      The following packages were automatically installed and are no longer required:
      libapache2-mod-php8.1 libonig5 php php-bcmath php-gd php-ldap php-mbstring php-xml php8.1 php8.1-bcmath php8.1-cli php8.1-gd php8.1-ldap
      php8.1-mbstring php8.1-opcache php8.1-readline php8.1-xml
      Use 'apt autoremove' to remove them.
      The following packages will be REMOVED:
      zabbix-apache-conf zabbix-frontend-php
      0 upgraded, 0 newly installed, 2 to remove and 3 not upgraded.
      After this operation, 45.4 MB disk space will be freed.
      Do you want to continue? [Y/n] y
      (Reading database ... 190146 files and directories currently installed.)
      Removing zabbix-apache-conf (1:6.4.14-1+ubuntu22.04) ...
      Conf zabbix disabled.
      To activate the new configuration, you need to run:
      systemctl reload apache2
      Removing zabbix-frontend-php (1:5.0.17+dfsg-1ubuntu0.1~esm1) ...
      apache2_invoke zabbix-frontend-php prerm: No action required
      root@ika:~# apt update
      Hit:1 https://apt.releases.hashicorp.com jammy InRelease
      Hit:2 http://apt.puppet.com jammy InRelease
      Hit:3 http://us.archive.ubuntu.com/ubuntu jammy InRelease
      Hit:4 https://repo.zabbix.com/zabbix/6.4/ubuntu jammy InRelease
      Hit:5 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease
      Hit:6 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease
      Hit:7 http://security.ubuntu.com/ubuntu jammy-security InRelease
      Hit:8 https://esm.ubuntu.com/apps/ubuntu jammy-apps-security InRelease
      Hit:9 https://esm.ubuntu.com/apps/ubuntu jammy-apps-updates InRelease
      Ign:10 https://bacula.org/packages/5f1e8eef....6/jammy/amd64 jammy InRelease
      Hit:11 https://esm.ubuntu.com/infra/ubuntu jammy-infra-security InRelease
      Hit:12 https://bacula.org/packages/5f1e8eef....6/jammy/amd64 jammy Release
      Hit:13 https://esm.ubuntu.com/infra/ubuntu jammy-infra-updates InRelease
      Reading package lists... Done
      Building dependency tree... Done
      Reading state information... Done
      3 packages can be upgraded. Run 'apt list --upgradable' to see them.
      N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://repo.zabbix.com/zabbix/6.4/ubuntu jammy InRelease' doesn't support architecture 'i386'
      N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://bacula.org/packages/5f1e8eefd1016/debs/11.0.6/jammy/amd64 jammy InRelease' doesn't support architecture 'i386'
      root@ika:~#
      root@ika:~# cat /etc/apt/sources.list.d/zabbix.list
      # Zabbix main repository
      deb https://repo.zabbix.com/zabbix/6.4/ubuntu jammy main
      deb-src https://repo.zabbix.com/zabbix/6.4/ubuntu jammy main

      # Zabbix unstable repository
      #deb https://repo.zabbix.com/zabbix/6.3/ubuntu jammy main
      #deb-src https://repo.zabbix.com/zabbix/6.3/ubuntu jammy main
      root@ika:~# apt install zabbix-frontend-php
      Reading package lists... Done
      Building dependency tree... Done
      Reading state information... Done
      The following NEW packages will be installed:
      zabbix-frontend-php
      0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
      Need to get 11.7 MB of archives.
      After this operation, 45.4 MB of additional disk space will be used.
      Get:1 https://esm.ubuntu.com/apps/ubuntu jammy-apps-security/main amd64 zabbix-frontend-php all 1:5.0.17+dfsg-1ubuntu0.1~esm1 [11.7 MB]
      Fetched 11.7 MB in 1s (8,851 kB/s)
      Selecting previously unselected package zabbix-frontend-php.
      (Reading database ... 187984 files and directories currently installed.)
      Preparing to unpack .../zabbix-frontend-php_1%3a5.0.17+dfsg-1ubuntu0.1~esm1_all.deb ...
      Unpacking zabbix-frontend-php (1:5.0.17+dfsg-1ubuntu0.1~esm1) ...
      Setting up zabbix-frontend-php (1:5.0.17+dfsg-1ubuntu0.1~esm1) ...
      root@ika:~#



      root@ika:~# apt-show-versions | grep zab
      zabbix-agent:amd64/jammy-apps-security 1:5.0.17+dfsg-1ubuntu0.1~esm1 uptodate
      zabbix-apache-conf:all/zabbix 1:6.4.14-1+ubuntu22.04 uptodate
      zabbix-frontend-php:all/jammy-apps-security 1:5.0.17+dfsg-1ubuntu0.1~esm1 uptodate
      zabbix-release:all/zabbix 1:6.4-1+ubuntu22.04 uptodate
      zabbix-server-pgsql:amd64/jammy-apps-security 1:5.0.17+dfsg-1ubuntu0.1~esm1 uptodate
      zabbix-sql-scripts:all/zabbix 1:6.4.14-1+ubuntu22.04 uptodate
      root@ika:~#
      root@ika:~#​


      Comment

      • mbw
        Junior Member
        • Oct 2022
        • 4

        #4

        I can confirm that there is definitely something wrong with the apt sources for zabbix 6.4:

        Following the web directions, I was getting version 5 of both zabbix-frontend-php and zabbix-server-pgsql

        When I manually downloaded these packages:


        root@ika:~# ls -l z*.deb
        -rw-rw-r-- 1 root root 7288336 Apr 22 02:21 zabbix-frontend-php_6.4.14-1+ubuntu22.04_all.deb
        -rw-rw-r-- 1 root root 3744 Mar 6 2023 zabbix-release_6.4-1+ubuntu22.04_all.deb
        -rw-rw-r-- 1 root root 1488788 Apr 22 02:21 zabbix-server-pgsql_6.4.14-1+ubuntu22.04_amd64.deb
        root@ika:~#

        and installed with dpkg -i,


        now everything is working

        root@ika:~# apt-show-versions | grep zabbix
        zabbix-agent:amd64/jammy-apps-security 1:5.0.17+dfsg-1ubuntu0.1~esm1 uptodate
        zabbix-frontend-php:all/zabbix 1:6.4.14-1+ubuntu22.04 uptodate
        zabbix-release:all/zabbix 1:6.4-1+ubuntu22.04 uptodate
        zabbix-server-pgsql:amd64/zabbix 1:6.4.14-1+ubuntu22.04 uptodate
        zabbix-sql-scripts:all/zabbix 1:6.4.14-1+ubuntu22.04 uptodate


        Hope this helps the maintainer of the directions at:

        https://www.zabbix.com/download?zabb...ubuntu&os_vers ion=22.04&components=server_frontend_agent&db=pgsq l&ws=apache

        Comment

        Working...