Applicable to:
- Plesk Onyx for Linux
- Plesk Onyx for Windows
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%admin\logs\php_error.log
on Windows Server:CONFIG_TEXT: 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:
CONFIG_TEXT: {"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:
Click on a section to expand
-
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
-
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 the
sqlite3.exe
file to the%plesk_dir%var\modules\wp-toolkit
folder. -
Open the
%plesk_dir%var\modules\wp-toolkit
folder and create a copy of the WordPress Toolkit databasewp-toolkit.sqlite3
. -
Start
sqlite3.exe
located in%plesk_dir%var\modules\wp-toolkit
and access the WordPress Toolkit database using the command:C:\> sqlite> .open wp-toolkit.sqlite3
-
Enable headers:
MYSQL_WIN: sqlite> .headers on
-
Get a WordPress instance ID using the domain ID from the error message. In this example, domainId is 123:
MYSQL_WIN: 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; -
Close the
sqlite3.exe
window.
Comments
5 comments
Just in case this helps anyone: I had this error and "select instanceId from InstancesDomains where domainId=123;" wasn't returning anything. I searched in the Instances table instead: "select * from Instances where domainID=123;" and was able to get the InstanceId that way.
In my case the InstanceId was actually associated with a different domainId in InstancesDomains:
select * from InstancesDomains where instanceId=789;
instanceId|domainId
789|124
After double checking that the domain in question (can be gotten from "select * from Instances where domainID=123;" )was indeed removed from Plesk, I ran the delete commands on instanceId 789 and that solved my problem.
@Tara
Thank you very much for your comment. I am sure that it would be helpful for other Plesk users!
See the steps on Resoultion for Plesk Onyx. They describe the solution better than the article itself, and of not clicked, can not be seen:
Resolution
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:
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 InstanceProperties WHERE instanceId=567;
sqlite> DELETE FROM InstancesDomains WHERE instanceId=567;
sqlite> DELETE FROM Instances where id=567;
Exit SQLite:
sqlite> .quit
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:
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 InstanceProperties WHERE instanceId=567;
sqlite> DELETE FROM InstancesDomains WHERE instanceId=567;
sqlite> DELETE FROM Instances where id=567;
Exit SQLite:
sqlite> .quit
Hello @Ehud,
Thank you for the feedback maybe your notes will be helpful for other Pleskians!
Some information in hidden in spoilers to make an article more compact and to make navigation between solutions for Linux and Windows easier.
Please sign in to leave a comment.