Issue How to repair "plesk repair db"

MHC_1

Regular Pleskian
Server operating system version
AlmaLinux 9
Plesk version and microupdate number
Plesk Obsidian, 18.0.74
Following on from the previous issue here Issue - Updating MariaDB from 10.5 to 10.11.4 breaks everything. I am trying to run

Plesk repair db

Because the issue appears to (now) be the Plesk operating Database tables are corrupted or non-existent.

So I run as the root user: Plesk repair db

and get the following:

[2025-10-29 09:45:00.812] 132208:6901e21cc62da ERR [panel] Cannot load settings: DB query failed: (1146) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'psa.misc' doesn't exist, query was: select param, val from misc
[2025-10-29 09:45:00.872] 132208:6901e21cc62da ERR [panel] Cannot save cli call statistic DB query failed: (1146) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'psa.CliCallsStat' doesn't exist, query was: INSERT CliCallsStat (`util`, `command`, `lastExecutionDateTime`) VALUES :)util, :command, now()) ON DUPLICATE KEY UPDATE `count` = `count` + 1, `lastExecutionDateTime` = now()

Checking the Plesk database using the native database server tools .. [OK]

Checking the structure of the Plesk database

The table accounts is absent ...................................... [ERROR]
Create table 'accounts'? [Y/n] y
Creating a database dump ........................................
Execution failed.
Command: mysqldump.sh
Arguments: Array
(
[0] => --title
[1] => preresolve
)

Details: Check the error reason (see log file: /var/log/plesk/mysqldump.log), fix and try again
Dump databases: psa mysql sys sys roundcubemail phpmyadmin
mariadb-dump: Couldn't execute 'show create table `transaction_registry`': Table 'mysql.transaction_registry' doesn't exist in engine (1932)
Trying to start service mariadb... active
done
Trying to establish test connection... connected
done
--------------
SELECT val FROM misc WHERE param = 'aps_database'
--------------

ERROR 1146 (42S02) at line 1: Table 'psa.misc' doesn't exist
InnoDB
=====================================
2025-10-29 09:45:12 0x7fa068721640 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 42 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 0 srv_active, 0 srv_shutdown, 1602 srv_idle
srv_master_thread log flush and writes: 1602
----------
SEMAPHORES
----------
------------
TRANSACTIONS
------------
Trx id counter 2374
Purge done for trx's n:eek: < 0 undo n:eek: < 0 state: running but idle
History list length 0
LIST OF TRANSACTIONS FOR EACH SESSION:
--------
FILE I/O
--------
Pending flushes (fsync): 0
281 OS file reads, 0 OS file writes, 60 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.07 fsyncs/s
---
LOG
---
Log sequence number 996009
Log flushed up to 996009
Pages flushed up to 968897
Last checkpoint at 968881
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 167772160
Dictionary memory allocated 848088
Buffer pool size 8112
Free buffers 7705
Database pages 407
Old database pages 0
Modified db pages 73
Percent of dirty pages(LRU & free pages): 0.900
Max dirty pages percent: 90.000
Pending reads 0
Pending writes: LRU 0, flush list 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 276, created 131, written 0
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 407, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 read views open inside InnoDB
state: sleeping
----------------------------
END OF INNODB MONITOR OUTPUT
============================



***** problem report *****
ERROR while trying to run the following SQL query: SELECT val FROM misc WHERE param = 'aps_database'

Dump databases: psa mysql sys sys roundcubemail phpmyadmin
Trying to Dump databases... mariadb-dump: Couldn't execute 'show create table `transaction_registry`': Table 'mysql.transaction_registry' doesn't exist in engine (1932)
mariadb-dump: Couldn't execute 'show create table `transaction_registry`': Table 'mysql.transaction_registry' doesn't exist in engine (1932)

***** problem report *****
ERROR while trying to Dump databases

Check the error reason (see log file: /var/log/plesk/mysqldump.log), fix and try again


exit status 1


Previously; I have already tried to manually insert missing tables ("DB query failed: (1146) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'psa.sessions' doesn't exist, query was: DESCRIBE `sessions` ") into the psa db but this returns with an error:


ERROR 1005 (HY000): Can't create table `psa`.`sessions` (errno: 184 "Tablespace already exists")


Any guidance how to repair re/install plesk Database basics ONLY, would be appreciated.
 

Summary outline:


Using Plesk db on the command line:
>> SELECT * FROM CliCallStat \g

ERROR 1146 (42S02): Table 'psa.CliCallStat' doesn't exist

>> CREATE TABLE `CliCallsStat` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`util` varchar(255) NOT NULL,
`command` varchar(255) NOT NULL,
`lastExecutionDateTime` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
`count` bigint(20) unsigned NOT NULL DEFAULT 1,
PRIMARY KEY (`id`),
UNIQUE KEY `utilCommand` (`command`,`util`)
) ENGINE=InnoDB AUTO_INCREMENT=3547 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; \g

ERROR 1005 (HY000): Can't create table `psa`.`CliCallsStat` (errno: 184 "Tablespace already exists")
ERROR: No query specified
 
If you have not already tried to do so, try to recover from a daily backup of the database: https://support.plesk.com/hc/en-us/...cess-Plesk-Table-psa-table-name-doesn-t-exist

If that doesn't work, I suggest opening a ticket with plesk support directly since they can work directly with you to get it going again.

Hello.

Yes, I can't submit a support request as this needs to be done by the partner/reseller. However, restoring from backup has already been attempted several times but with no success. The issue is that there are "phantom" tables in the InnoDb tablespace listing ; These are tables that used to exist, don't exist, but can not be created because they already exist. More details about the issue can be found here: How to resolve "phantom" tables in the tablespace?
 
You can still created a ticket directly with Plesk if your reseller is not able to support you, you just need to pay for the support subscription (they usually have a 30 day trial so you can sign up for that support trial to get your support then cancel it so you don't pay for it). Refer to the second link I provided in my last post.
 
Back
Top