FATAL: Connection to Cacti database failed

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
EvilNate
Posts: 5
Joined: Thu Jan 12, 2023 4:15 pm

FATAL: Connection to Cacti database failed

Post by EvilNate »

I followed the guide at this location https://techviewleo.com/install-and-con ... cle-linux/ to install Cacti and had it working but then I attempted to also install LibreNMS on the same system following the guide at this location https://docs.librenms.org/Installation/ ... nux-server and now I am getting an error in Cacti. I have tried to completely remove apache, php, mariaDB, and do a fresh install of cacti but I am still getting the same error. The Maria DB is running and the credentials in the config file are correct. I still think that the application or MariaDB is referencing a bad php path. What do I need to do to get Cacti working again?

FATAL: Connection to Cacti database failed. Please ensure:

the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid.

Code: Select all

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           └─php-fpm.conf, php81-php-fpm.conf
   Active: active (running) since Mon 2023-01-16 19:25:58 EST; 20min ago
     Docs: man:httpd.service(8)
 Main PID: 1676 (httpd)
   Status: "Total requests: 5; Idle/Busy workers 100/0;Requests/sec: 0.00403; Bytes served/sec:   3 B/sec"
    Tasks: 278 (limit: 153432)
   Memory: 60.1M
   CGroup: /system.slice/httpd.service
           ├─1676 /usr/sbin/httpd -DFOREGROUND
           ├─1704 /usr/sbin/httpd -DFOREGROUND
           ├─1705 /usr/sbin/httpd -DFOREGROUND
           ├─1706 /usr/sbin/httpd -DFOREGROUND
           ├─1707 /usr/sbin/httpd -DFOREGROUND
           └─3100 /usr/sbin/httpd -DFOREGROUND

Jan 16 19:25:58 vecacti-r1-as01 systemd[1]: Starting The Apache HTTP Server...
Jan 16 19:25:58 vecacti-r1-as01 httpd[1676]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.64.22.23. Set the 'ServerName' directive globally to suppress this message
Jan 16 19:25:58 vecacti-r1-as01 systemd[1]: Started The Apache HTTP Server.
Jan 16 19:25:58 vecacti-r1-as01 httpd[1676]: Server configured, listening on: port 80

Code: Select all

PHP 7.4.33 (cli) (built: Dec 19 2022 13:23:13) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
[root@vecacti-r1-as01 mariadb]#

Code: Select all

[root@vecacti-r1-as01 mariadb]#              systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2023-01-16 19:25:58 EST; 22min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 1434 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
  Process: 1229 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
  Process: 1179 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 1283 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 74 (limit: 153432)
   Memory: 220.5M
   CGroup: /system.slice/mariadb.service
           └─1283 /usr/libexec/mysqld --basedir=/usr

Jan 16 19:25:57 vecacti-r1-as01 systemd[1]: Starting MariaDB 10.3 database server...
Jan 16 19:25:57 vecacti-r1-as01 mysql-prepare-db-dir[1229]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Jan 16 19:25:57 vecacti-r1-as01 mysql-prepare-db-dir[1229]: If this is not the case, make sure the /var/lib/mysql is empty before running mysql-prepare-db-dir.
Jan 16 19:25:57 vecacti-r1-as01 mysqld[1283]: 2023-01-16 19:25:57 0 [Note] /usr/libexec/mysqld (mysqld 10.3.35-MariaDB) starting as process 1283 ...
Jan 16 19:25:58 vecacti-r1-as01 systemd[1]: Started MariaDB 10.3 database server.
[root@vecacti-r1-as01 mariadb]#
EvilNate
Posts: 5
Joined: Thu Jan 12, 2023 4:15 pm

Re: FATAL: Connection to Cacti database failed

Post by EvilNate »

Disregard, it looks like HTTPD was still referencing PHP 8.1. I manually located the file, removed it and restarted the service.

Code: Select all

[root@vecacti-r1-as01 httpd]# find / -name php81-php-fpm.conf
find: ‘/proc/3259/task/3259/net’: Invalid argument
find: ‘/proc/3259/net’: Invalid argument
/usr/lib/systemd/system/httpd.service.d/php81-php-fpm.conf
/usr/lib/systemd/system/nginx.service.d/php81-php-fpm.conf
[root@vecacti-r1-as01 httpd]# cd /usr/lib/systemd/system
[root@vecacti-r1-as01 system]# cd httpd.service.d
[root@vecacti-r1-as01 httpd.service.d]# ls
php81-php-fpm.conf  php-fpm.conf
[root@vecacti-r1-as01 httpd.service.d]# ^C
[root@vecacti-r1-as01 httpd.service.d]# rm php81-php-fpm.conf
rm: remove regular file 'php81-php-fpm.conf'? y
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests