Applicable to:
- Plesk for Linux
Symptoms
1. The following error occurs on an attempt to enter Domains > example.com > Applications :
ERROR: Call to a member function getWordPress() on null (Instances.php:152)
2. The following SQL query can be found with enabled debug (SQL queries) in /var/log/plesk/panel.log:
[2017-06-01 10:38:26] DEBUG [dbquery] [135] SQL: SELECT `smb_apsInstances`.* FROM `smb_apsInstances` AS `smb_apsInstances` WHERE (`registryResourceId` = '0b52b2e3-f878-4535-aa39-f422e47df05d')
[2017-06-01 10:38:26] DEBUG [dbquery] [135] END: 0.00022602081298828 sec
[01-Jun-2017 10:38:26 Europe/Berlin] 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
3.
registryResourceId
from the query in step 2. is missing in the table
smb_apsInstances
:
# plesk db "select * from smb_apsInstances where 'registryResourceId' = '0b52b2e3-f878-4535-aa39-f422e47df05d';"
Empty set (0.00 sec)
Cause
Database inconsistency.
Resolution
1. Create a backup of
psa
and
apsc databases
:
# mysqldump psa -uadmin -p`cat /etc/psa/.psa.shadow` > psa_current.sql
# mysqldump apsc -uadmin -p`cat /etc/psa/.psa.shadow` > apsc_current.sqll
2. Check that
registryResourceId
exists in apsc database:
# plesk db
mysql> select * from apsc.aps_registry_object where uid='0b52b2e3-f878-4535-aa39-f422e47df05d';
+----+--------------------------------------+--------------+---------------------+---------+
| id | uid | type | creation_time | enabled |
+----+--------------------------------------+--------------+---------------------+---------+
| 8 | d0dc710a-74ec-4fb2-8b5f-d2b7ccb1de00 | aps.resource | 2017-05-29 23:45:10 | y |
+----+--------------------------------------+--------------+---------------------+---------+
If this query returns empty set then please refer to the following article:
APSC inconsistency: Cannot find registry resource for Application ID
3. Check that affected domain is presented in apsContexts table:
mysql> select id from domains where name='example.com';
+----+
| id |
+----+
| 1 |
mysql> select * from psa.apsContexts where pleskId=1;
+----+-----------+---------+-------+----------------+
| id | pleskType | pleskId | ssl | subscriptionId |
+----+-----------+---------+-------+----------------+
| 1 | hosting | 1 | false | 3 |
4. Find all required values to insert:
mysql> select id from smb_apsPackages where vendor like '%WordPress%';
mysql> select id as metaID from smb_apsMetas where serviceId like '%wordpress%';
+----+
| id |
+----+
| 2 |
+----+
mysql> select id as parentContextID from smb_apsContexts where packageId=2 and contextType=0;
+-----------------+
| parentContextID |
+-----------------+
| 3 |
mysql> select id as ContextID from smb_apsContexts where packageId=2 and contextType=1;
+-----------+
| ContextID |
+-----------+
| 4 |
+--------+
| metaID |
+--------+
| 2 |
5. Get registryResourceId from the error message and insert correct value into smb_apsInstances:
mysql>
insert into smb_apsInstances (parentContextId,contextId,metaId,registryResourceId) values (3,2,2,'0b52b2e3-f878-4535-aa39-f422e47df05d');
Comments
0 comments
Please sign in to leave a comment.