Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
Cannot access Plesk from WHMCS via API as a customer or change password:
CONFIG_TEXT: Error code: 1013. Error message: Customer with external id 'whmcs_plesk_XX' is not found in panel.
CONFIG_TEXT: Error code: 1013. Error message: Customer with email 'johndoe@example.com' is not found in panel. Please contact your service provider.
Cause
The external_id
entry is missing in psa.clients
MySQL table.
Resolution
Note: if the issue appears on WHMCS integrated with Plesk Multi Server, this database update should be done on the management node side.
-
Log in to the server via SSH
-
Create a backup of psa database:
# plesk db dump > psa.current.sql
-
Access Plesk database from command line:
# plesk db
-
Update the following value:
MYSQL_LIN: 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.
For several accounts
- List all orphaned client accounts (which has no external_id or it is invalid):
MYSQL_LIN: 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';
- Create a file with all
external_id
extracted from WHMCS database. -
Log in to WHMCS database via PHPMyAdmin or via MySQL CLI and list all
external_id
:CONFIG_TEXT: SELECT tblhosting.username, mod_pleskaccounts.panelexternalid FROM mod_pleskaccounts, tblhosting where mod_pleskaccounts.userid = tblhosting.userid and tblhosting.username <> '';
-
Back up Plesk database:
# plesk db dump psa > 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 -
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 the result in
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 |
+-------------------+----------+--------------------------------------+
-
Back up Plesk 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 -
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 the result in
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
0 comments
Please sign in to leave a comment.