Applicable to:
- Plesk for Linux
Symptoms
-
Pressing [change login settings] in the WP Toolkit within the Plesk GUI returns an error:
PLESK_ERROR: Internal error:
Unable to find row with id in smb_apsMetas table.
Cause
A Plesk database inconsistency is causing the error.
When you enable debug mode and Plesk (while making sure SQL query debug logs are enabled) and reproduce the issue after this has been done, messages that are similar to the following can be seen in the in the /var/log/plesk/panel.log of the server:
CONFIG_TEXT: [2018-05-19 00:25:22] DEBUG [dbquery] [72] SQL: SELECT `smb_apsInstances`.* FROM `smb_apsInstances` WHERE (((`smb_apsInstances`.`id` = 29)))
[2018-05-19 00:25:22] DEBUG [dbquery] [72] END: 0.00771 sec
[2018-05-19 00:25:22] ERR [panel] Unable to find row with id in smb_apsMetas table.:
Resolution
In order to correct the issues tied to the smb_apsMetas table (any other connected table) in the Plesk database (psa), you must follow these steps:
- Connect to the server via SSH
-
Back up the
psadatabase# plesk db dump psa > backup.sql
-
Access MariaDB
# plesk db
-
Use the
smb_apsInstancesID that you saw in/var/log/plesk/panel.login order to find other IDs tied to this instance (such as the context ID and the meta ID):
Note: If you have not saved it, you can find it easily by running the
grep id /var/log/plesk/panel.logcommandMYSQL_LIN: SELECT * FROM smb_apsInstances WHERE id=29;
+----+-----------------+-----------+--------+---------------------------+---------------------------+
| id | parentContextId | contextId | metaId | uuid | registryResourceId |
+----+-----------------+-----------+--------+---------------------------+---------------------------+
| 29 | 36 | 41 | 12 | a3133579-...-1ef4c1dfbdb3 | 8e786998-...-03ae740b6c54 |
+----+-----------------+-----------+--------+---------------------------+---------------------------+
1 row in set (0.00 sec) -
Use the newly acquired context ID and meta ID in order to find entries tied to it:
MYSQL_LIN: SELECT * FROM smb_apsMetas WHERE id=12;
+----+-----------+-----------+----------------------------------------------+-------+-----------+
| id | name | serviceId | xpath | class | contextId |
+----+-----------+-----------+----------------------------------------------+-------+-----------+
| 12 | WordPress | wordpress | aps::aps12::http://wordpress.org/::wordpress | | 36 |
+----+-----------+-----------+----------------------------------------------+-------+-----------+
1 row in set (0.00 sec)MYSQL_LIN: SELECT * FROM smb_apsContexts WHERE id=36;
+----+-------------+-----------+-------------------------+----------------------+
| id | contextType | packageId | requirementContextClass | requirementContextId |
+----+-------------+-----------+-------------------------+----------------------+
| 36 | 0 | 12 | NULL | NULL |
+----+-------------+-----------+-------------------------+----------------------+
1 row in set (0.00 sec) -
If you see a lack of content (such as NULL being shown), restore these database entries manually from the last valid
psadatabase dump in/var/lib/psa/dumps/.For example:
MYSQL_LIN: INSERT INTO smb_apsInstances VALUES (29,36,41,12,'a3133579-XXXX-XXXX-XXXX-1ef4c1dfbdb3','8e786998-XXXX-XXXX-XXXX-03ae740b6c54');
Query OK, 1 row affected (0.01 sec)MYSQL_LIN: INSERT INTO smb_apsMetas VALUES (12,'WordPress','wordpress','aps::aps12::http://wordpress.org/::wordpress','',36);
Query OK, 1 row affected (0.01 sec)MYSQL_LIN: INSERT INTO smb_apsContexts VALUES (36,0,12,NULL,NULL);
Query OK, 1 row affected (0.01 sec)
If the issue persists, follow these steps:
1. Back up the WP Toolkit SQLite database
# cp /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3{,.backup}
2. Fix the extra records from the WP Toolkit database with these commands
# sqlite3 /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .mode column
sqlite> .headers ON
sqlite> select * from Instances where apsInstanceId=29;
id domainId path isIgnored apsInstanceId
---------- ---------- ---------- ---------- -------------
1 4 /httpdocs 0
sqlite> update Instances set apsInstanceId=NULL where id=1;
3. Go to Tools & Settings > WordPress and run Check for Updates
Comments
Please sign in to leave a comment.