×


WHMCS error code 1013 - Fix it Now ?

WHMCS allows setting up servers for Plesk Hosting Accounts in Plesk 11-12. WHMCS error code 1013 is usually seen while doing the setup.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Plesk queries.

In this context, we shall look into methods to tackle this WHMCS error.


Causes and Fixes for WHMCS error code 1013

To set up a Plesk package, we have to go do the following steps:

i. First, go to Configuration ().

ii. Then take System Settings.

iii. Now, go to Products/Services (prior to WHMCS 8.0) Setup > Products/Services > Products/Services.


While accessing the Plesk account that is set up using these package, we may get some errors. One of them is shown below:

Error message: Customer with email 'linuxapt@example.com' is not found in panel. Please contact your service provider

There are two potential causes of this error message:

1. The product type not set correctly in WHMCS.

This means that a reseller plan is configured as a shared hosting product in WHMCS or vice versa.

Following are the steps to resolve this:

i. Firstly, we have to log in to WHMCS Admin Area.

ii. Then navigate to Configuration () and take System Settings.

iii. From there go to Products/Services.

iv. And we must review the Product Type settings.

v. Here we must ensure to adjust to Shared Hosting or Reseller Hosting to match the Plesk plan type.

vi. Finally, we can click Save Changes.


2. Missing data from a table inside Plesk.

The error could also happen due toexternal_id entry missing in psa.clients MySQL table.

Users may also notice that they cannot access Plesk from WHMCS via API as a customer or cannot change passwords. Furthermore, we will get either of the two errors given below:

 Error code: 1013. Error message: Customer with external id 'whmcs_plesk_XX' is not found in panel.

or

Error code: 1013. Error message: Customer with email 'linuxapt@example.com' is not found in panel. Please contact your service provider.


Following are the steps to fix this:

1. Firstly, log in to the server via SSH

2. Then, create a backup of the psa database.

We can use the following command for this:

# plesk db dump > psa.current.sql

3. Then, access Plesk database from the command line using the following command:

# plesk db

4. After that update the following value:

update clients set external_id='whmcs_plesk_XX' where login='linuxapt';


For several accounts

If we are facing this error for multiple accounts we can do the following to fix this.

1. Firstly,  we need to list all orphaned client accounts:

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';

2. Then create a file with all external_id extracted from the WHMCS database.

3. After that log in to the WHMCS database via PHPMyAdmin or via MySQL CLI and list all external_id:

SELECT tblhosting.username, mod_pleskaccounts.panelexternalid FROM mod_pleskaccounts, tblhosting where mod_pleskaccounts.userid = tblhosting.userid and tblhosting.username <> '';

Further steps for Linux

1. We have to back up the Plesk database. For this we can use the following command:

# plesk db dump psa > psa.current.sql

2. Then we have to 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

3. And take the ID and customer login from the customers.txt file. After that, set IDs for clients with the appropriate logins using the following:

# while read i j; do plesk db "update clients set external_id='$j' where login='$i'"; done < customers.txt

4. Finally, check the result in psa.clients the 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 | +——————-+———-+————————————–+


Further steps for Windows

1. We must first back up the Plesk database:

C:\> plesk db dump psa > psa_backup.sql

2. After that we must 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

3. Then 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'

4. Finally, we can 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 | +——————-+———-+————————————–+


[Need assistance in fixing Plesk errors ? We can help you.]


Conclusion

This article covers WHMCS error code 1013. Basically, this error happens when the external_id entry is missing in psa.clients MySQL table. If the issue appears on WHMCS integrated with Plesk Multi Server, this database update should be done on the management node side.