Articles in this section

Plesk shows the error: Error 1034: Index for table 'log_actions' is corrupt

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • When logging in to Plesk, the following error message is shown in a web browser:

    PLESK_INFO: Server Error

    500 Plesk\Exception\Database

    DB query failed: (1034) SQLSTATE[HY000]: General error: 1034 Index for table 'log_actions' is corrupt; try to repair it, query was: SELECT COUNT(*) AS `count` FROM `log_actions` AS `a` WHERE <...>

    Note: The table name in the error message may be different.

  • When updating Plesk or creating a dump of the Plesk database, the operation fails with:

    CONFIG_TEXT: Trying to backup MySQL database... mysqldump: Error 1034: Index for table 'log_actions' is corrupt; try to repair it when dumping table log_actions at row: 0

Cause

The table, mentioned in the error message, is corrupt.

Resolution

Restore the corrupt tables from a Plesk daily dump:

  1. Connect to your Plesk server via SSH.
  2. Switch to the directory with daily dumps:

    # cd /var/lib/psa/dumps

  3. List all available Plesk daily dumps:

    # ls -l mysql.daily*
    -rw------- 1 root root 236253 Feb 3 01:51 mysql.daily.dump.0.gz
    -rw------- 1 root root 229653 Feb 2 01:48 mysql.daily.dump.1.gz
    -rw------- 1 root root 222485 Feb 1 01:56 mysql.daily.dump.2.gz

  4. Restore the tables mentioned in the error message from the latest available backup. In this example, table log_actions is restored from the daily dump mysql.daily.dump.0.gz:

    # zcat mysql.daily.dump.0.gz | sed -n '/-- Table structure for table `log_actions`/,/-- Table*/p' | plesk db

  5. Scan the Plesk database for the errors:

    # plesk repair db -n

    Note: In case other tables are reported as corrupt, restore them too. At this point, ignore any warnings reported by the utility.

  6. Once all broken tables are repaired, finish repairing the database with the command

    # plesk repair db -y
     

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.