FATAL: Connection to Cacti database failed

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Moderators, Developers

Post Reply
Author
Message
ahiyaz
Posts: 19
Joined: Mon Jul 29, 2019 9:31 am

FATAL: Connection to Cacti database failed

#1 Post by ahiyaz » Thu Oct 10, 2019 5:34 am

hi all

ive installed cacti 1.2.7 on ubuntu 18.04
the server was up ive configure devices, graphs.
i had a log error "DEBUG Falling back to UDP Ping Due to SetUID Issues"

ive started troubleshooting and while troubleshooting,
mistakenly ive reinstall spine "apt install cacti-spine"
and since then i cant get cacti ui -- FATAL: Connection to Cacti database failed. Please ensure the database is running and your credentials in config.php are valid.
ive tried to change url_path in global/config.php files to '/' but it didn't help.


i can't find any log error that explains what's up.
ive logged in DB with cacti credentials and was successful.

when executing mysql and apache status it running but iget these lines:

[email protected]:/opt/cacti/cli# systemctl status mysql
? mariadb.service - MariaDB 10.1.41 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-10-10 14:33:24 IDT; 1h 21min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 7812 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 7806 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Process: 7620 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR
Process: 7611 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 7591 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 7738 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 67 (limit: 4915)
CGroup: /system.slice/mariadb.service
mq7738 /usr/sbin/mysqld

Oct 10 14:33:23 cacti systemd[1]: Starting MariaDB 10.1.41 database server...
Oct 10 14:33:23 cacti mysqld[7738]: 2019-10-10 14:33:23 140182296231040 [Note] /usr/sbin/mysqld (mysqld 10.1.41-MariaDB-0ubuntu0.18.04.1) starting as process 7738 ...
Oct 10 14:33:24 cacti /etc/mysql/debian-start[7815]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Oct 10 14:33:24 cacti /etc/mysql/debian-start[7815]: Looking for 'mysql' as: /usr/bin/mysql
Oct 10 14:33:24 cacti /etc/mysql/debian-start[7815]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Oct 10 14:33:24 cacti /etc/mysql/debian-start[7815]: This installation of MySQL is already upgraded to 10.1.41-MariaDB, use --force if you still need to run mysql_upgrade
Oct 10 14:33:24 cacti /etc/mysql/debian-start[7823]: Checking for insecure root accounts.
Oct 10 14:33:24 cacti systemd[1]: Started MariaDB 10.1.41 database server.
[email protected]:/opt/cacti/cli#


any idea how to get out of this situation?

thanks

ahiyaz
Posts: 19
Joined: Mon Jul 29, 2019 9:31 am

Re: FATAL: Connection to Cacti database failed

#2 Post by ahiyaz » Thu Oct 10, 2019 5:52 am

when looking in-browser dev tools i saw something wired
it seems I redirected to another object http://172.16.0.48/favicon.ico


cacti.png
cacti.png (62.12 KiB) Viewed 137 times

netniV
Cacti Guru User
Posts: 2882
Joined: Sun Aug 27, 2017 12:05 am

Re: FATAL: Connection to Cacti database failed

#3 Post by netniV » Thu Oct 10, 2019 10:45 am

The second part is not weird as it's a standard browser feature.

Your problem is that the config.php and spine.conf should have the same database connection details and likely doesn't have since you reinstalled.

Post Reply