Applicable to:
- Plesk 11.x for Windows
- Plesk 12.5 for Linux
- Plesk 12.5 for Windows
- Plesk Onyx for Linux
- Plesk Onyx for Windows
Symptoms
The following error occurs while accessing Plesk from WHMCS via API as customer with login johndoe or changing the password:
CONFIG_TEXT: Error code: 1013. Error message: Customer with external id 'whmcs_plesk_XX' is not found in panel.
Cause
external_id
entry is missing in psa.clients
MySQL table. In case it happens during the migration, check this article: Cannot login to Plesk via WHMCS after migration: Customer with external id 'whmcs_plesk_XX' is not found in panel
Resolution
Note: To view all orphaned client accounts (which has no or invalid external_id),the following MySQL query can be used:
mysql> select id,cname,pname,login from clients where parent_id = 1 and (external_id = NULL or external_id = '0' or external_id = '') and clients.type <> 'reseller';
Note: if the issue appears on a WHMCS integrated with Plesk Multi Server, this database update should be done on the management node side.
-
Log into the server via SSH.
-
Create a backup of psa database:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump psa -uadmin > psa.current.sql
- Access Plesk database from command line:
# plesk db
-
Update the following value:
MYSQL_LIN: mysql> update clients set external_id='whmcs_plesk_XX' where login='johndoe';
where whmcs_plesk_XX - should be replaced with ID from the error
johndoe - should be replaced with login of the customer affected by the issue.
Additional Information
It is possible to apply the fix for all domains at once, however, file with all external_id
extracted from WHMCS database is required for that. The following query will retrieve such information:
CONFIG_TEXT: SELECT tblhosting.username, mod_pleskaccounts.panelexternalid FROM mod_pleskaccounts, tblhosting where mod_pleskaccounts.userid = tblhosting.userid and tblhosting.username <> '';
For Linux
- Create a backup of psa database:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump psa -uadmin > psa.current.sql
- Prepare a file with logins of the customers and external IDs, separated by spaces:
# cat customers.txt
cus1 f8fc8a02-870a-483a-8de7-2f2cf6d16ace
edjhlbrh 1d0fa7bc-ecd8-4689-9931-99146b22a657 - Execute the following command to will take the ID and customer login from the customers.txt file and set IDs for clients with the appropriate logins:
# while read i j; do plesk db "update clients set external_id='$j' where login='$i'"; done < customers.txt
- Check
psa.clients
table:# plesk db "select pname,login,external_id from clients"
+-------------------+----------+--------------------------------------+
| pname | login | external_id |
+-------------------+----------+--------------------------------------+
| Administrator | admin | NULL |
| SomeCustomer | cus1 | f8fc8a02-870a-483a-8de7-2f2cf6d16ace |
| whmcsReseller | res | 1d0fa7bc-ecd8-4689-9931-99146b22a657 |
+-------------------+----------+--------------------------------------+
For Windows
- Back up psa database:
C:\> plesk db dump psa > psa_backup.sql
- Prepare a file with logins of the customers and external IDs, separated by spaces:
C:\> more customers.txt
cus1 f8fc8a02-870a-483a-8de7-2f2cf6d16ace
edjhlbrh 1d0fa7bc-ecd8-4689-9931-99146b22a657 - Execute the following command in Command Prompt to take the ID and customer login from the customers.txt file and set IDs for clients with the appropriate logins:
C:\> for /f "usebackq tokens=1,2" %a in (customers.txt) do plesk db "update clients set external_id='%b' where login='%a'"
- Check
psa.clients
table:C:\> plesk db "select pname,login,external_id from clients"
+-------------------+----------+--------------------------------------+
| pname | login | external_id |
+-------------------+----------+--------------------------------------+
| Administrator | admin | NULL |
| SomeCustomer | cus1 | f8fc8a02-870a-483a-8de7-2f2cf6d16ace |
| whmcsReseller | res | 1d0fa7bc-ecd8-4689-9931-99146b22a657 |
+-------------------+----------+--------------------------------------+
Comments
7 comments
when i execute this i got ERROR 1046 (3D000): No database selected
what is the name of database?
i solve with this:
http://kb.odin.com/en/123492
@Felipe, you might have not logged in to the Plesk database properly. I have added this step to the article. Thanks for the reporting.
Reproduced same issue on Plesk Onyx 17.5 on Windows Server 2012 R2
External ID-s are lost on every Plesk Onyx Update (happened 2x times withing last month)
@Kotso, Can you please clarify whether the issue is reproduced after forcing Plesk to reinstall microupdates with the command below:
plesk installer --select-release-current --reinstall-patch --upgrade-installed-components
Please, do not forget to make a dump of Plesk database. using this KB article https://support.plesk.com/hc/en-us/articles/213904125-How-to-backup-restore-a-Plesk-database-dump
we are facing different issue with same error code
Error code: 1013. Error message: Customer with email 'XXXX@gmail.com' is not found in panel. Please contact your service provider.
Hello @Sathiya,
As I can see, the issue is already under the investigation in the scope of a ticket, as additional checks are required to find the cause.
Please sign in to leave a comment.