• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Resolved unable to create exp_event

sebgonzes

Silver Pleskian
Hello

We had an issue with our mysql database server last week and have had to restore plesk database with automatical dumps.
All gone fine exept exp_event table that give us en mysql error restore, and we are unable to restore it
It's not an essencial table, so all work fine, but we would have an optimal plesk situation and this table had to work, how I can create is again?


CREATE TABLE `exp_event` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
`source` enum('pa','plesk') DEFAULT NULL,
`event_type` enum('started','stopped','created','updated','deleted','status_changed','terminated','flushed','installed','uninstalled','siteapp_added','siteapp_removed','expired','exceeded','guid_changed') NOT NULL DEFAULT 'started',
`obj_class` varchar(255) NOT NULL DEFAULT 'license',
`obj_id` varchar(255) NOT NULL,
`host` varchar(255) NOT NULL,
`user` varchar(255) NOT NULL,
`flushed` enum('true','false') NOT NULL DEFAULT 'false',
PRIMARY KEY (`id`),
KEY `source` (`source`,`event_type`),
KEY `flushed` (`flushed`),
KEY `source_2` (`source`,`event_type`,`obj_class`),
KEY `source_3` (`source`,`event_time`,`event_type`,`obj_class`)
) ENGINE=InnoDB AUTO_INCREMENT=3295241 DEFAULT CHARSET=utf8;


ERROR 1005 (HY000): Can't create table `psa`.`exp_event` (errno: 168 "Unknown (generic) error from engine") mariadb is 10.1.48.
 
Recreated table without any problem:

Code:
MariaDB [psa]> show create table exp_event\G
*************************** 1. row ***************************
       Table: exp_event
Create Table: CREATE TABLE `exp_event` (
  `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
  `source` enum('pa','plesk') DEFAULT NULL,
  `event_type` enum('started','stopped','created','updated','deleted','status_changed','terminated','flushed','installed','uninstalled','siteapp_added','siteapp_removed','expired','exceeded','guid_changed') NOT NULL DEFAULT 'started',
  `obj_class` varchar(255) NOT NULL DEFAULT 'license',
  `obj_id` varchar(255) NOT NULL,
  `host` varchar(255) NOT NULL,
  `user` varchar(255) NOT NULL,
  `flushed` enum('true','false') NOT NULL DEFAULT 'false',
  PRIMARY KEY (`id`),
  KEY `source` (`source`,`event_type`),
  KEY `flushed` (`flushed`),
  KEY `source_2` (`source`,`event_type`,`obj_class`),
  KEY `source_3` (`source`,`event_time`,`event_type`,`obj_class`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

MariaDB [psa]> drop table exp_event;
Query OK, 0 rows affected (0.10 sec)

MariaDB [psa]> CREATE TABLE `exp_event` (
    ->   `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    ->   `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
    ->   `source` enum('pa','plesk') DEFAULT NULL,
    ->   `event_type` enum('started','stopped','created','updated','deleted','status_changed','terminated','flushed','installed','uninstalled','siteapp_added','siteapp_removed','expired','exceeded','guid_changed') NOT NULL DEFAULT 'started',
    ->   `obj_class` varchar(255) NOT NULL DEFAULT 'license',
    ->   `obj_id` varchar(255) NOT NULL,
    ->   `host` varchar(255) NOT NULL,
    ->   `user` varchar(255) NOT NULL,
    ->   `flushed` enum('true','false') NOT NULL DEFAULT 'false',
    ->   PRIMARY KEY (`id`),
    ->   KEY `source` (`source`,`event_type`),
    ->   KEY `flushed` (`flushed`),
    ->   KEY `source_2` (`source`,`event_type`,`obj_class`),
    ->   KEY `source_3` (`source`,`event_time`,`event_type`,`obj_class`)
    -> ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.06 sec)

MariaDB [psa]> select * from exp_event;
Empty set (0.01 sec)

Code:
# mysql --version
mysql  Ver 15.1 Distrib 5.5.64-MariaDB, for Linux (x86_64) using readline 5.1
 
Recreated table without any problem:

Code:
MariaDB [psa]> show create table exp_event\G
*************************** 1. row ***************************
       Table: exp_event
Create Table: CREATE TABLE `exp_event` (
  `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
  `source` enum('pa','plesk') DEFAULT NULL,
  `event_type` enum('started','stopped','created','updated','deleted','status_changed','terminated','flushed','installed','uninstalled','siteapp_added','siteapp_removed','expired','exceeded','guid_changed') NOT NULL DEFAULT 'started',
  `obj_class` varchar(255) NOT NULL DEFAULT 'license',
  `obj_id` varchar(255) NOT NULL,
  `host` varchar(255) NOT NULL,
  `user` varchar(255) NOT NULL,
  `flushed` enum('true','false') NOT NULL DEFAULT 'false',
  PRIMARY KEY (`id`),
  KEY `source` (`source`,`event_type`),
  KEY `flushed` (`flushed`),
  KEY `source_2` (`source`,`event_type`,`obj_class`),
  KEY `source_3` (`source`,`event_time`,`event_type`,`obj_class`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

MariaDB [psa]> drop table exp_event;
Query OK, 0 rows affected (0.10 sec)

MariaDB [psa]> CREATE TABLE `exp_event` (
    ->   `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    ->   `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
    ->   `source` enum('pa','plesk') DEFAULT NULL,
    ->   `event_type` enum('started','stopped','created','updated','deleted','status_changed','terminated','flushed','installed','uninstalled','siteapp_added','siteapp_removed','expired','exceeded','guid_changed') NOT NULL DEFAULT 'started',
    ->   `obj_class` varchar(255) NOT NULL DEFAULT 'license',
    ->   `obj_id` varchar(255) NOT NULL,
    ->   `host` varchar(255) NOT NULL,
    ->   `user` varchar(255) NOT NULL,
    ->   `flushed` enum('true','false') NOT NULL DEFAULT 'false',
    ->   PRIMARY KEY (`id`),
    ->   KEY `source` (`source`,`event_type`),
    ->   KEY `flushed` (`flushed`),
    ->   KEY `source_2` (`source`,`event_type`,`obj_class`),
    ->   KEY `source_3` (`source`,`event_time`,`event_type`,`obj_class`)
    -> ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.06 sec)

MariaDB [psa]> select * from exp_event;
Empty set (0.01 sec)

Code:
# mysql --version
mysql  Ver 15.1 Distrib 5.5.64-MariaDB, for Linux (x86_64) using readline 5.1
Hello, our version is a quite superior (10.2)
 
@IgorG Problem have been solved finally.

inicialy, no exp_event.frm are present in psa directory database, but logical error


MariaDB [psa]> DROP TABLE exp_event;
ERROR 1051 (42S02): Unknown table 'psa.exp_event'

MariaDB [psa]> CREATE TABLE `exp_event2` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT, `source` enum('pa','plesk') DEFAULT NULL, `event_type` enum('started','stopped','created','updated','deleted','status_changed','terminated','flushed','installed','uninstalled','siteapp_added','siteapp_removed','expired','exceeded','guid_changed') NOT NULL DEFAULT 'started', `obj_class` varchar(255) NOT NULL DEFAULT 'license', `obj_id` varchar(255) NOT NULL, `host` varchar(255) NOT NULL, `user` varchar(255) NOT NULL, `flushed` enum('true','false') NOT NULL DEFAULT 'false', PRIMARY KEY (`id`), KEY `source` (`source`,`event_type`), KEY `flushed` (`flushed`), KEY `source_2` (`source`,`event_type`,`obj_class`), KEY `source_3` (`source`,`event_time`,`event_type`,`obj_class`) ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)



MariaDB [psa]> RENAME TABLE exp_event2 TO exp_event;
ERROR 1050 (42S01): Table './psa/exp_event' already exists

MariaDB [psa]> drop table exp_event2;
Query OK, 0 rows affected (0.01 sec)

Finally, I copy file from another server, so then :

plesk db
MariaDB [psa]> select * from exp_event;
ERROR 1030 (HY000): Got error 194 "Tablespace is missing for a table" from storage engine InnoDB


MariaDB [psa]> drop table exp_event;
Query OK, 0 rows affected (0.01 sec)


MariaDB [psa]> CREATE TABLE `exp_event` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `id` bigint(10) unsigned NOT NULL AUTO_INCREMENT, `source` enum('pa','plesk') DEFAULT NULL, `event_type` enum('started','stopped','created','updated','deleted','status_changed','terminated','flushed','installed','uninstalled','siteapp_added','siteapp_removed','expired','exceeded','guid_changed') NOT NULL DEFAULT 'started', `obj_class` varchar(255) NOT NULL DEFAULT 'license', `obj_id` varchar(255) NOT NULL, `host` varchar(255) NOT NULL, `user` varchar(255) NOT NULL, `flushed` enum('true','false') NOT NULL DEFAULT 'false', PRIMARY KEY (`id`), KEY `source` (`source`,`event_type`), KEY `flushed` (`flushed`), KEY `source_2` (`source`,`event_type`,`obj_class`), KEY `source_3` (`source`,`event_time`,`event_type`,`obj_class`) ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)

This is our solution in our case, sometime not the better, but seem working.
 
Back
Top