Symptoms
After removing a sub-domain with WordPress instance, the following error message appears in Plesk/WordPress Toolkit (ID in the error message may vary):
PLESK_ERROR: Can not find domain by id 123
This error message may also appear:
-
in email notifications about application updates sent form Plesk to a domain owner:
PLESK_INFO: Updates were not installed for the following items:
1. Instance “My CMS” (https://example.com): Can not find domain by id 123 -
when trying to remove a WordPress plugin that was installed on the deleted domain:
PLESK_ERROR: Installation “example”: Can not find domain by id 123″
-
when searching for this domain using Plesk search.
-
in a Linux command-line interface, when running the Plesk Daily Maintenance task:
# /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 -
in the Plesk logfile
/var/log/plesk/panel.log
on Linux or in%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"}
- Instances were previously removed via filesystem in
/var/www/vhosts/example.com/httpdocs
Cause
Product issue:
-
#EXTWPTOOLK-2454 “WordPress Toolkit now properly cleans up its database when a subdomain with WordPress installation is removed in Plesk.”
Fixed in:- WordPress Toolkit 3.6.0 21 February 2019
Resolution
Please consider updating your server:
Workaround
As a workaround, update WordPress Toolkit to the latest version. In case the issue persists, use the following workaround:
For Plesk Onyx on Linux Server
-
Connect to the Plesk server via SSH.
-
For security purposes, create a dump of the Plesk database:
# plesk db dump psa > psa.sql
-
Remove leftovers from the Plesk database:
# plesk db “truncate longtasks”
# plesk db “truncate longtaskparams” -
For security reasons, create a backup of the WordPress Toolkit database:
# cp -p /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3{,.backup}
-
Access the WordPress Toolkit database in SQLite:
# sqlite3 /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3
-
Enable headers:
MYSQL_LIN: sqlite> .headers on
-
Get a WordPress instance ID using the domain ID from the error message. In this example, domainId is 123.
MYSQL_LIN: sqlite> select instanceId from InstancesDomains where domainId=123;
instanceId
567 -
Remove all corresponding information:
MYSQL_LIN: sqlite> DELETE FROM InstanceProperties WHERE instanceId=567;
sqlite> DELETE FROM InstancesDomains WHERE instanceId=567;
sqlite> DELETE FROM Instances where id=567; -
Exit SQLite:
MYSQL_LIN: sqlite> .quit
For Plesk Onyx on Windows Server
-
Connect to the Plesk server via RDP.
-
For security purposes, create a dump of the Plesk database:
C:> plesk db dump psa > C:psa.sql
-
Remove leftovers from the Plesk database:
C:> plesk db “truncate longtasks”
C:> plesk db “truncate longtaskparams” -
Download a bundle of command-line tools for managing SQLite database files and extract the file
sqlite3.exe
. -
Copy…