Articles in this section

Unable to login to Plesk: 1015 Can't lock file (errno: 165 - Table is read only)

Plesk for Windows Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Windows
  • Plesk for Linux

Symptoms

Plesk is not accessible with the following error:

PLESK_ERROR: ERROR: Plesk\Exception\Database
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)))

The same error is shown executing Plesk-related commands, for example:

# plesk login
ERR [panel] Cannot save cli call statistic DB query failed: SQLSTATE[HY000]: General error: 1015 Can't lock file (errno: 165 - Table is read only), query was: INSERT CliCallsStat (`util`, `command`, `lastExecutionDateTime`) VALUES (:util, :command, now()) ON DUPLICATE KEY UPDATE `count` = `count` + 1, `lastExecutionDateTime` = now()
DB query failed: SQLSTATE[HY000]: General error: 1015 Can't lock file (errno: 165 - Table is read only), query was: INSERT INTO password_secrets (secret, type, id, created) VALUES ("", "1", "", now());
exit status 1

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%MySQL\my.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

  1. Connect to the server via SSH/RDP.

  2. Complete the InnoDB recovery process:

Was this article helpful?

Comments

1 comment
Date Votes
  • -bash: innodb_force_recovery : commande introuvable

    0

Please sign in to leave a comment.