Hi Dude, some time ago I experienced an error with my cacti server. This error occurs after performing a cacti package upgrade. After a bit of research by googling, I was finally concluded that my database feels corrupted. This post i will share experience how to cacti repair databases after upgrade.
First time, our cacti server encountered this error message in cacti logs:
CMDPHP ERROR: A DB Cell Failed!, Error: MySQL server has gone away
With detail like below.
2021-01-27 14:56:01 - CMDPHP SQL Backtrace: (/poller.php[824]:bad_index_check(), /poller.php[832]:db_fetch_cell(), /lib/database.php[386]:db_fetch_cell_prepared(), /lib/database.php[402]:db_execute_prepared())
2021-01-27 14:56:01 - CMDPHP ERROR: A DB Cell Failed!, Error: MySQL server has gone away
2021-01-27 14:56:01 - CMDPHP SQL Backtrace: (/poller.php[823]:api_plugin_hook(), /lib/plugins.php[63]:db_fetch_assoc_prepared(), /lib/database.php[490]:db_execute_prepared())
2021-01-27 14:56:01 - CMDPHP ERROR: A DB Row Failed!, Error: MySQL server has gone away
2021-01-27 14:56:01 - CMDPHP SQL Backtrace: (/poller.php[818]:dsdebug_poller_bottom(), /lib/dsdebug.php[150]:db_fetch_assoc(), /lib/database.php[476]:db_fetch_assoc_prepared(), /lib/database.php[490]:db_execute_prepared())
Here is screenshoot in cacti dashboard.
Here are the steps to do:
- Enter the cacti installation directory.
cd /usr/share/cacti/cli
- Execute database repair with repair_database.php
In directory/usr/share/cacti/cli
run command below.
[root@container cli]# php repair_database.php
Yes, finally error has gone. My cacti server running well and.
That is my way to fix and repair cacti databases corrupt after upgrade. Maybe usefull.