cacti DB failed, updgrade lost everything

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Moderators, Developers

Author
Message
netniV
Cacti Guru User
Posts: 2808
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti DB failed, updgrade lost everything

#16 Post by netniV » Fri Jan 05, 2018 3:40 pm

OK, the very first thing that really stuck out to me was that it claims your settings table has crashed and needs to be repaired. Also, a lot of tables are missing so It would appear something is seriously wrong with the database. Do you have a backup from before the upgrade?

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#17 Post by mrscary » Mon Jan 08, 2018 7:24 am

i had noticed that same issue, and I attempted to repair it before the upgrade to no avail.
I then made a copy of that database folder, attempted to do the upgrade, and well, the rest went down hill.
at this point I think im going to have to start over, which means importing all my tempaltes, scripts, etc.. unfortunately, I used to rely on a lot of the plug ins, and I think those no longer work whatsoever.

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

Re: cacti DB failed, updgrade lost everything

#18 Post by netniV » Mon Jan 08, 2018 8:12 am

That would depend on the plugin. Some may work but any errors and 1.x will automajically disable them.

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#19 Post by mrscary » Mon Jan 08, 2018 8:33 am

wish there was a way to repair my old database so I didn't have to start from scratch.

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

Re: cacti DB failed, updgrade lost everything

#20 Post by netniV » Mon Jan 08, 2018 8:38 am

There may be if you google for it. Unfortunately, I only know how to use MySQL and not an advanced supporter of it.

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#21 Post by mrscary » Mon Jan 08, 2018 8:50 am

looks like cacti has its own repair_database.php. I ran that got this back
Repairing All Cacti Database Tables
Repairing Table -> 'automation_devices' Successful
Repairing Table -> 'automation_graph_rule_items' Successful
Repairing Table -> 'automation_graph_rules' Successful
Repairing Table -> 'automation_ips' Successful
Repairing Table -> 'automation_match_rule_items' Successful
Repairing Table -> 'automation_processes' Successful
Repairing Table -> 'automation_templates' Successful
Repairing Table -> 'automation_tree_rule_items' Successful
Repairing Table -> 'automation_tree_rules' Successful
Repairing Table -> 'cdef' Successful
Repairing Table -> 'cdef_items' Successful
Repairing Table -> 'colors' Successful
Repairing Table -> 'data_input' Successful
Repairing Table -> 'data_input_data' Successful
Repairing Table -> 'data_input_fields' Successful
Repairing Table -> 'data_local' Successful
Repairing Table -> 'data_source_stats_hourly_cache' Successful
Repairing Table -> 'data_source_stats_hourly_last' Successful
Repairing Table -> 'data_template' Successful
Repairing Table -> 'data_template_data' Successful
Repairing Table -> 'data_template_data_rra' Successful
Repairing Table -> 'data_template_rrd' Successful
Repairing Table -> 'graph_local' Successful
Repairing Table -> 'graph_template_input' Successful
Repairing Table -> 'graph_template_input_defs' Successful
Repairing Table -> 'graph_templates' Successful
Repairing Table -> 'graph_templates_gprint' Successful
Repairing Table -> 'graph_templates_graph' Successful
Repairing Table -> 'graph_templates_item' Successful
Repairing Table -> 'graph_tree' Successful
Repairing Table -> 'graph_tree_items' Successful
Repairing Table -> 'host' Successful
Repairing Table -> 'host_graph' Successful
Repairing Table -> 'host_snmp_cache' Successful
Repairing Table -> 'host_snmp_query' Successful
Repairing Table -> 'host_template' Successful
Repairing Table -> 'host_template_graph' Successful
Repairing Table -> 'host_template_snmp_query' Successful
Repairing Table -> 'manage_admin_link' Successful
Repairing Table -> 'manage_alerts' Successful
Repairing Table -> 'manage_groups' Successful
Repairing Table -> 'manage_host' Successful
Repairing Table -> 'manage_poller_output' Successful
Repairing Table -> 'manage_process' Successful
Repairing Table -> 'manage_services' Successful
Repairing Table -> 'manage_sites' Successful
Repairing Table -> 'manage_tcp' Successful
Repairing Table -> 'manage_templates' Successful
Repairing Table -> 'manage_uptime_method' Successful
Repairing Table -> 'plugin_autom8_graph_rule_items' Successful
Repairing Table -> 'plugin_autom8_graph_rules' Successful
Repairing Table -> 'plugin_autom8_match_rule_items' Successful
Repairing Table -> 'plugin_autom8_thold_rule_items' Successful
Repairing Table -> 'plugin_autom8_thold_rules' Successful
Repairing Table -> 'plugin_autom8_tree_rule_items' Successful
Repairing Table -> 'plugin_autom8_tree_rules' Successful
Repairing Table -> 'plugin_config' Successful
Repairing Table -> 'plugin_db_changes' Successful
Repairing Table -> 'plugin_discover_hosts' Successful
Repairing Table -> 'plugin_discover_template' Successful
Repairing Table -> 'plugin_hooks' Successful
Repairing Table -> 'plugin_nectar' Successful
Repairing Table -> 'plugin_nectar_items' Successful
Repairing Table -> 'plugin_notification_lists' Successful
Repairing Table -> 'plugin_realms' Successful
Repairing Table -> 'plugin_snmpagent_cache' Successful
Repairing Table -> 'plugin_snmpagent_cache_notifications' Successful
Repairing Table -> 'plugin_snmpagent_cache_textual_conventions' Successful
Repairing Table -> 'plugin_snmpagent_managers' Successful
Repairing Table -> 'plugin_snmpagent_managers_notifications' Successful
Repairing Table -> 'plugin_snmpagent_mibs' Successful
Repairing Table -> 'plugin_snmpagent_notifications_log' Successful
Repairing Table -> 'plugin_thold_contacts' Successful
Repairing Table -> 'plugin_thold_host_failed' Successful
Repairing Table -> 'plugin_thold_log' Successful
Repairing Table -> 'plugin_thold_template_contact' Successful
Repairing Table -> 'plugin_thold_threshold_contact' Successful
Repairing Table -> 'plugin_usersettings' Successful
Repairing Table -> 'poller' Successful
Repairing Table -> 'poller_command' Successful
Repairing Table -> 'poller_item' Successful
Repairing Table -> 'poller_output' Successful
Repairing Table -> 'poller_output_boost_processes' Successful
Repairing Table -> 'poller_output_rt' Successful
Repairing Table -> 'poller_reindex' Successful
Repairing Table -> 'poller_time' Successful
Repairing Table -> 'reports' Successful
Repairing Table -> 'reports_items' Successful
Repairing Table -> 'rra' Successful
Repairing Table -> 'rra_cf' Successful
Repairing Table -> 'settings' Successful
Repairing Table -> 'settings_graphs' Successful
Repairing Table -> 'settings_tree' Successful
Repairing Table -> 'settings_user' Successful
Repairing Table -> 'snmp_query' Successful
Repairing Table -> 'snmp_query_graph' Successful
Repairing Table -> 'snmp_query_graph_rrd' Successful
Repairing Table -> 'snmp_query_graph_rrd_sv' Successful
Repairing Table -> 'snmp_query_graph_sv' Successful
Repairing Table -> 'snmpagent_cache' Successful
Repairing Table -> 'snmpagent_cache_notifications' Successful
Repairing Table -> 'snmpagent_cache_textual_conventions' Successful
Repairing Table -> 'snmpagent_managers' Successful
Repairing Table -> 'snmpagent_managers_notifications' Successful
Repairing Table -> 'snmpagent_mibs' Successful
Repairing Table -> 'snmpagent_notifications_log' Successful
Repairing Table -> 'thold_data' Successful
Repairing Table -> 'thold_template' Successful
Repairing Table -> 'user_auth' Successful
Repairing Table -> 'user_auth_perms' Successful
Repairing Table -> 'user_auth_realm' Successful
Repairing Table -> 'user_log' Successful
Repairing Table -> 'version' Successful

NOTE: Checking for Invalid Cacti Templates
NOTE: 66 Invalid Data Input Data Rows based upon template mappings found in Dat
Templates
NOTE: 3 Invalid Data Input Data rows based upon field mappings found in Data Te
plates

WARNING: Cacti Template Problems found in your Database. Using the '--force' o
tion will remove
the invalid records. However, these changes can be catastrophic to existing da
a sources. Therefore, you
should contact your support organization prior to proceeding with that repair.

I didn't get any error when logging in (oh, the upgrade wanted to run again).. but when I login, all I get now is a white screen.

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#22 Post by mrscary » Mon Jan 08, 2018 9:43 am

ok I did a few things.. being desperate and all.
I got the db upgraded.. I got logged in.. my devices are all there.. but my settings are kinda jacked. I need to set the paths of my poller, spine, etc, but it wont keep my settings.


mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#24 Post by mrscary » Mon Jan 08, 2018 9:58 am

most recent CLOG after I cleared it
2018-01-08 06:57:48 - WEBUI: Cacti Log Cleared from Web Management Interface
01/08/2018 06:57:48 - WEBUI NOTE: Cacti Log file C:/inetpub/wwwroot/cacti/log/cacti.log, Removed by user admin
01/08/2018 06:57:49 - CMDPHP SQL Backtrace: (C:\inetpub\wwwroot\cacti\poller.php: 514 db_fetch_cell_prepared)(C:\inetpub\wwwroot\cacti\lib\database.php: 280 cacti_debug_backtrace)
01/08/2018 06:57:49 - DBCALL ERROR: SQL Assoc Failed!, Error:2006, SQL:'SELECT po.output, po.time, UNIX_TIMESTAMP(po.time) as unix_time, po.local_data_id, dl.data_template_id, pi.rrd_path, pi.rrd_name, pi.rrd_num FROM poller_output AS po INNER JOIN poller_item AS pi ON po.local_data_id=pi.local_data_id AND po.rrd_name=pi.rrd_name INNER JOIN data_local AS dl ON dl.id=po.local_data_id ORDER BY po.local_data_id LIMIT 40000'
01/08/2018 06:57:49 - DBCALL ERROR: SQL Assoc Failed!, Error: MySQL server has gone away
01/08/2018 06:57:49 - CMDPHP SQL Backtrace: (C:\inetpub\wwwroot\cacti\poller.php: 539 process_poller_output)(C:\inetpub\wwwroot\cacti\lib\poller.php: 384 db_fetch_assoc)(C:\inetpub\wwwroot\cacti\lib\database.php: 360 db_fetch_assoc_prepared)(C:\inetpub\wwwroot\cacti\lib\database.php: 401 cacti_debug_backtrace)
01/08/2018 06:57:50 - CMDPHP SQL Backtrace: (C:\inetpub\wwwroot\cacti\poller.php: 514 db_fetch_cell_prepared)(C:\inetpub\wwwroot\cacti\lib\database.php: 280 cacti_debug_backtrace)
01/08/2018 06:57:50 - DBCALL ERROR: SQL Assoc Failed!, Error:2006, SQL:'SELECT po.output, po.time, UNIX_TIMESTAMP(po.time) as unix_time, po.local_data_id, dl.data_template_id, pi.rrd_path, pi.rrd_name, pi.rrd_num FROM poller_output AS po INNER JOIN poller_item AS pi ON po.local_data_id=pi.local_data_id AND po.rrd_name=pi.rrd_name INNER JOIN data_local AS dl ON dl.id=po.local_data_id ORDER BY po.local_data_id LIMIT 40000'
01/08/2018 06:57:50 - DBCALL ERROR: SQL Assoc Failed!, Error: MySQL server has gone away
01/08/2018 06:57:50 - CMDPHP SQL Backtrace: (C:\inetpub\wwwroot\cacti\poller.php: 539 process_poller_output)(C:\inetpub\wwwroot\cacti\lib\poller.php: 384 db_fetch_assoc)(C:\inetpub\wwwroot\cacti\lib\database.php: 360 db_fetch_assoc_prepared)(C:\inetpub\wwwroot\cacti\lib\database.php: 401 cacti_debug_backtrace)
01/08/2018 06:57:51 - CMDPHP SQL Backtrace: (C:\inetpub\wwwroot\cacti\poller.php: 514 db_fetch_cell_prepared)(C:\inetpub\wwwroot\cacti\lib\database.php: 280 cacti_debug_backtrace)
01/08/2018 06:57:51 - DBCALL ERROR: SQL Assoc Failed!, Error:2006, SQL:'SELECT po.output, po.time, UNIX_TIMESTAMP(po.time) as unix_time, po.local_data_id, dl.data_template_id, pi.rrd_path, pi.rrd_name, pi.rrd_num FROM poller_output AS po INNER JOIN poller_item AS pi ON po.local_data_id=pi.local_data_id AND po.rrd_name=pi.rrd_name INNER JOIN data_local AS dl ON dl.id=po.local_data_id ORDER BY po.local_data_id LIMIT 40000'
01/08/2018 06:57:51 - DBCALL ERROR: SQL Assoc Failed!, Error: MySQL server has gone away
01/08/2018 06:57:51 - CMDPHP SQL Backtrace: (C:\inetpub\wwwroot\cacti\poller.php: 539 process_poller_output)(C:\inetpub\wwwroot\cacti\lib\poller.php: 384 db_fetch_assoc)(C:\inetpub\wwwroot\cacti\lib\database.php: 360 db_fetch_assoc_prepared)(C:\inetpub\wwwroot\cacti\lib\database.php: 401 cacti_debug_backtrace)

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

Re: cacti DB failed, updgrade lost everything

#25 Post by netniV » Mon Jan 08, 2018 10:02 am

Something really isn't right here because that means the website is losing connectivity to the database whilst running the query:
https://dev.mysql.com/doc/refman/5.7/en/gone-away.html

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#26 Post by mrscary » Mon Jan 08, 2018 10:12 am

ok wait.. im back in.. all my devices are there.
I had to stop MySQL.. copy my settings tables from my backup to the current directory, restart MySQL and the settings all showed up. I even sent a test message and it showed up.
im going to wait to see if my graphs actually populate data.

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#27 Post by mrscary » Mon Jan 08, 2018 10:26 am

zero data on my graphs.. logs don't show much, ill up load one in a little bit.. gotta fix an MS office issue on my PC first.
I log in, I get a white screen.. I F5, cacti shows up.
my settings WERE there.. now I cant get into that section .. it just doesn't do anything.

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

Re: cacti DB failed, updgrade lost everything

#28 Post by netniV » Mon Jan 08, 2018 10:30 am

As well as your cacti logs, I would also check your apache logs to see what they show.

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#29 Post by mrscary » Mon Jan 08, 2018 10:37 am

running on IIS

mrscary
Cacti User
Posts: 58
Joined: Tue Aug 26, 2014 2:58 pm

Re: cacti DB failed, updgrade lost everything

#30 Post by mrscary » Mon Jan 08, 2018 10:39 am

dunno if this helps.. but I get this error when I try to run the poller manually..

c:\php\php.exe c:\inetpub\wwwroot\cacti\poller.php
Cannot load Zend OPcache - it was already loaded

Post Reply