Symptoms
-
After removing a domain with a WordPress instance, an error message starts to appear on the Plesk Panel:
Can not find domain by id 123
-
Email notifications from Plesk may be received by domain owners about application updates:
Updates were not installed for the following items:
1. Instance "My Instance Name" (https://example.com): Can not find domain by id 123 -
An attempt to remove a plugin from another Wordpress instance fails with:
Installation "example": Can not find domain by id 123"
-
The following records can be found in the Plesk log files
/var/log/plesk/panel.log
on Linux or%plesk_dir%admin\logs\php_error.log
on Windows Server:Failed to generate screenshot of instance #5: URL of instance #5 is empty
ERR [extension/wp-toolkit] Can not find domain by id 123 -
Unable to remove Wordpress instance via Applications. The following message is returned on a blank page:
{"status":"success"}
-
The Wordpress instance files were manually from
/var/www/vhosts/example.com/httpdocs
.
Cause
Orphaned data in WordPress SQLite database for the removed domain
Resolution
Apply the corresponding steps:
-
Connect to the Plesk server via SSH.
-
Remove any possible tasks leftover from the Plesk database:
# plesk db "truncate longtasks"
# plesk db "truncate longtaskparams" -
Create a backup of the WP Toolkit database:
# cp -p /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3{,.backup}
-
Access the WP Toolkit database in SQLite:
# sqlite3 /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3
-
Enable headers:
# sqlite> .headers on
-
Get a WordPress instance ID using the domain ID from the error message. In this example,
domainId
is 123:# sqlite> select instanceId from Instances where domainId=123;
instanceId
567 -
Remove all corresponding information:
sqlite> DELETE FROM InstanceProperties WHERE instanceId=567;
sqlite> DELETE FROM InstancesDomains WHERE instanceId=567;
sqlite> DELETE FROM Instances where id=567;Note: If more than one instance id was listed on the previous step output, execute the above InstanceProperties, InstanceDomains and Insntances deletions for each ID number accordingly.
-
Exit SQLite:
# sqlite> .quit
-
Connect to the Plesk server via RDP.
-
Download the command tool for managing SQLite databases and extract
sqlite3.exe
into%plesk_dir%var\modules\wp-toolkit
. -
Open a command prompt (CMD) as Administrator and remove possible tasks leftovers from the Plesk database:
C:\> plesk db "truncate longtasks"
C:\> plesk db "truncate longtaskparams" -
Create a backup copy of the WP Toolkit database:
C:\> copy "%plesk_dir%var\modules\wp-toolkit\wp-toolkit.sqlite3" "%plesk_dir%var\modules\wp-toolkit\wp-toolkit.sqlite3.bak"
-
Open the downloaded tool and access the WP Toolkit database:
C:\> "%plesk_dir%var\modules\wp-toolkit\sqlite3.exe" "%plesk_dir%var\modules\wp-toolkit\wp-toolkit.sqlite3"
-
Enable headers:
sqlite> .headers on
-
Get a WordPress instance ID using the domain ID from the error message. In this example, domainId is
123
:sqlite> select instanceId from Instances where domainId=123;
instanceId
567 -
Remove all corresponding information leftovers:
sqlite> DELETE FROM InstanceProperties WHERE instanceId=567;
sqlite> DELETE FROM InstancesDomains WHERE instanceId=567;
sqlite> DELETE FROM Instances where id=567;Note: If more than one instance id was listed on the previous step output, execute the above InstanceProperties, InstanceDomains and Insntances deletions for each ID number accordingly.
-
Exit from
sqlite3.exe
then close the CMD console:sqlite> .quit
Click on a section to expand
Comments
1 comment
What is the difference between the SQLite tables Instances and InstancesDomains?
In my case, I get error messages such as:
or
When looking up entries in table InstanceDomains, I do not find id 11 or 61. However, they DO exist in table Instances. So I assume you should adjust step 8 as it also allows to find the instanceID from the table instances (named id in that table).
Please sign in to leave a comment.