Cacti / plugin_mactrack

Mactrack Plugin for Cacti
GNU General Public License v2.0
12 stars 24 forks source link

CMDPHP ERROR: A DB Exec Failed!, Error: Table 'cacti.mac_track_ips' doesn't exist #182

Closed asr-ales10it closed 11 months ago

asr-ales10it commented 1 year ago
2023-03-15 15:49:20 - CMDPHP ERROR: A DB Exec Failed!, Error: Tablespace for table '`cacti`.`mac_track_ips`' exists. Please DISCARD the tablespace before IMPORT -- 2023-03-15 15:44:04 - CMDPHP ERROR: A DB Exec Failed!, Error: Table 'cacti.mac_track_ips' doesn't exist 2023-03-15 15:44:04 - CMDPHP ERROR: A DB Row Failed!, Error: Table 'cacti.mac_track_ips' doesn't exist 2023-03-15 15:44:00 - CMDPHP ERROR: A DB Exec Failed!, Error: Table 'cacti.mac_track_ips' doesn't exist I have the reported errors. I see in /var/lib/mysql/cacti there is only mac_track_ips.ibd file with out FRM and if i try to create the table: MariaDB [cacti]> CREATE TABLE `mac_track_ips` ( `site_id` int(10) unsigned NOT NULL DEFAULT '0', `device_id` int(10) unsigned NOT NULL DEFAULT '0', `hostname` varchar(40) NOT NULL DEFAULT '', `device_name` varchar(100) NOT NULL DEFAULT '', `port_number` varchar(20) NOT NULL DEFAULT '', `mac_address` varchar(20) NOT NULL DEFAULT '', `ip_address` varchar(20) NOT NULL DEFAULT '', `dns_hostname` varchar(200) DEFAULT '', `scan_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`scan_date`,`ip_address`,`mac_address`,`site_id`), KEY `ip` (`ip_address`), KEY `port_number` (`port_number`), KEY `mac` (`mac_address`), KEY `device_id` (`device_id`), KEY `site_id` (`site_id`), KEY `hostname` (`hostname`), KEY `scan_date` (`scan_date`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; ERROR 1813 (HY000): Tablespace for table '`cacti`.`mac_track_ips`' exists. Please DISCARD the tablespace before IMPORT MariaDB [cacti]> CREATE TABLE `mac_track_ips` ( `site_id` int(10) unsigned NOT NULL DEFAULT '0', `device_id` int(10) unsigned NOT NULL DEFAULT '0', `hostname` varchar(40) NOT NULL DEFAULT '', `device_name` varchar(100) NOT NULL DEFAULT '', `port_number` varchar(20) NOT NULL DEFAULT '', `mac_address` varchar(20) NOT NULL DEFAULT '', `ip_address` varchar(20) NOT NULL DEFAULT '', `dns_hostname` varchar(200) DEFAULT '', `scan_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`scan_date`,`ip_address`,`mac_address`,`site_id`), KEY `ip` (`ip_address`), KEY `port_number` (`port_number`), KEY `mac` (`mac_address`), KEY `device_id` (`device_id`), KEY `site_id` (`site_id`), KEY `hostname` (`hostname`), KEY `scan_date` (`scan_date`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; ERROR 1050 (42S01): Table '`cacti`.`mac_track_ips`' already exists Cacti Version 1.2.24 MacTrack Version 4.5 Suggestions?
TheWitness commented 11 months ago

Sounds like your database corrupted. With InnoDB tables, if you delete either the ibdata or ib_logfile* files, you will corrupt the table. What you need to do is delete the mac_track_ips.ibd file, and then drop the table, and re-create it afterwards.