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"
-
An execution of the Plesk Daily Maintenance task on Linux shows a similar error:
# /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php
...
ERR [panel] pm_Exception: 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%adminlogsphp_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:
For Plesk on Linux Server
-
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 InstancesDomains where domainId=123;
instanceId
567 -
Remove all corresponding information:
# sqlite> DELETE FROM Instances where domainId=123;
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
For Plesk on Windows Server
-
Connect to the Plesk server via RDP.
-
Download the command tool for managing SQLite databases and extract
sqlite3.exe
into%plesk_dir%varmoduleswp-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%varmoduleswp-toolkitwp-toolkit.sqlite3" "%plesk_dir%varmoduleswp-toolkitwp-toolkit.sqlite3.bak"
-
Open the downloaded tool and access the WP Toolkit database:
C:> "%plesk_dir%varmoduleswp-toolkitsqlite3.exe" "%plesk_dir%varmoduleswp-toolkitwp-toolkit.sqlite3"
-
Enable headers:
sqlite> .headers on
-
Get a WordPress instance ID using the domain ID from the error…