Symptoms
Plesk is not accessible with the following error:
ERROR: PleskExceptionDatabase
DB query failed: SQLSTATE[HY000]: General error: 1015 Can't lock file (errno: 165 - Table is read only), query was: DELETE FROM `SessionContexts` WHERE (`sessionId` IN (SELECT `sessions`.`sess_id` FROM `sessions` WHERE (`modified` + `lifetime` < 1522082154)))
Cause
InnoDB is in a non-finished recovery process.
MySQL/MariaDB configuration file includes the innodb_force_recovery
parameter at level 4
or higher:
-
For Linux:
-
CentOS/RHEL:
# grep innodb_force_recovery /etc/my.cnf
innodb_force_recovery = 4 -
Debian/Ubuntu:
# grep innodb_force_recovery /etc/mysql/my.cnf
innodb_force_recovery = 4
-
-
For Windows:
C:> findstr innodb_force_recovery "%plesk_dir%MySQLmy.ini"
innodb_force_recovery = 5
This causes InnoDB to be set to the a read-only
mode as per the official documentation provided by MySQL.
Resolution
-
Complete the InnoDB recovery process: