Applicable to:
- Plesk for Linux
Symptoms
-
The following error message is shown on an attempt to enter Domains > example.com > Applications:
CONFIG_TEXT: ERROR: Call to a member function getWordPress() on null (Instances.php:152)
-
The following SQL query can be found with enabled debug in
/var/log/plesk/panel.log
:CONFIG_TEXT: DEBUG [dbquery] [135] SQL: SELECT `smb_apsInstances`.* FROM `smb_apsInstances` AS `smb_apsInstances` WHERE (`registryResourceId` = '0b52b2e3-f878-4535-aa39-f422e47df05d')
DEBUG [dbquery] [135] END: 0.00022602081298828 sec
PHP Fatal error: Call to a member function getWordPress() on null in /usr/local/psa/admin/plib/Smb/View/List/App/Instances.php on line 152
Cause
Database inconsistency in regards to WordPress application: registryResourceId
is missing in the table smb_apsInstances
.
Resolution
-
Connect to the server via SSH.
-
Create a backup of
psa
andapsc databases
:# mysqldump psa -uadmin -p`cat /etc/psa/.psa.shadow` > psa_current.sql
# mysqldump apsc -uadmin -p`cat /etc/psa/.psa.shadow` > apsc_current.sql
-
Check that
registryResourceId
from the error message exists inapsc
database:# plesk db
MYSQL_LIN: select * from apsc.aps_registry_object where uid='0b52b2e3-f878-4535-aa39-f422e47df05d';
+----+--------------------------------------+--------------+---------------------+---------+
| id | uid | type | creation_time | enabled |
+----+--------------------------------------+--------------+---------------------+---------+
| 3 | 0b52b2e3-f878-4535-aa39-f422e47df05d | aps.resource | 2020-01-14 02:42:42 | y |
+----+--------------------------------------+--------------+---------------------+---------+ -
Check that affected domain is presented in
apsContexts
table:MYSQL_LIN: select id from domains where name='example.com';
+----+
| id |
+----+
| 1 |
+----+MYSQL_LIN: select * from psa.apsContexts where pleskId=1;
+----+-----------+---------+-------+----------------+
| id | pleskType | pleskId | ssl | subscriptionId |
+----+-----------+---------+-------+----------------+
| 1 | hosting | 1 | false | 1 |
+----+-----------+---------+-------+----------------+ | -
Find all required values to insert:
MYSQL_LIN: select id from smb_apsPackages where vendor like '%WordPress%';
+----+
| id |
+----+
| 2 |
+----+MYSQL_LIN: select id as parentContextID from smb_apsContexts where packageId=2 and contextType=0;
+-----------------+
| parentContextID |
+-----------------+
| 3 |
+-----------------+MYSQL_LIN: mysql> select id as ContextID from smb_apsContexts where packageId=2 and contextType=1;
+-----------+
| ContextID |
+-----------+
| 4 |
+-----------+ -
Get
registryResourceId
from the error message and insert the correct value intosmb_apsInstances
:MYSQL_LIN: mysql> insert into smb_apsInstances (parentContextId,contextId,metaId,registryResourceId) values (3,4,1,'0b52b2e3-f878-4535-aa39-f422e47df05d');
Comments
0 comments
Please sign in to leave a comment.