Ricardo Lobo

Member
Oct 11, 2016
23
2
3
Brazil
cPanel Access Level
Root Administrator
Hello,

We use (cPanel API 2) to create, delete and change accounts on our server.

I have the following scenario:

When a user already exists on the server, a new account with a similar domain is not created.

Example:
Existing account: domainname1.com - user: domainna
New account: domainname2.com - user: domainna

Note: So far, so good.

The problem is that the API is in a loop trying to create the account, and through the error log, we see the API working 24 hours a day, taking up server resources.

How can I interrupt the loop? I cannot delete the account, it is automatically recreated.

I appreciate the help
Ricardo Lobo
 

cPanelTJ

Product Owner
Staff member
Jan 29, 2019
97
49
93
Houston, TX
cPanel Access Level
Root Administrator
Twitter
@Ricardo Lobo

I'd be happy to help investigate your issue.

Are you certain that it is a cPanel API 2 call that you are using? Could you share the specific function please?

What you are describing sounds a lot like WHM API 1 createacct, modifyacct, and removeacct.

When I use createacct as you describe in your scenario, I see the following in the error log:
Code:
[2020-04-16 13:27:31 -0500] info [xml-api] (XID esj3sv) This system already has an account named “domainna”. at /usr/local/cpanel/Whostmgr/Accounts/Create.pm line 623.
 [createacct] version [1].
Could you share this portion of your log so that we can see the frequency of the looping? Also, what version of cPanel & WHM are you on?
 
  • Like
Reactions: Ricardo Lobo

Ricardo Lobo

Member
Oct 11, 2016
23
2
3
Brazil
cPanel Access Level
Root Administrator
@Ricardo Lobo

I'd be happy to help investigate your issue.

Are you certain that it is a cPanel API 2 call that you are using? Could you share the specific function please?

What you are describing sounds a lot like WHM API 1 createacct, modifyacct, and removeacct.

When I use createacct as you describe in your scenario, I see the following in the error log:
Code:
[2020-04-16 13:27:31 -0500] info [xml-api] (XID esj3sv) This system already has an account named “domainna”. at /usr/local/cpanel/Whostmgr/Accounts/Create.pm line 623.
[createacct] version [1].
Could you share this portion of your log so that we can see the frequency of the looping? Also, what version of cPanel & WHM are you on?

Sorry, all the WHM API 1 and cPanel API 2 functions are in a single file, I expressed myself wrong.

We are using the "createacct" function of the WHM API 1

This is my error log:
Code:
[2020-04-17 22:05:57 -0300] info [xml-api] (XID rsmfep) O domínio “xxxxxxxxxxxxx.com.br” já existe nos dados do usuário. [createacct] version [2].
CPanel version:
CENTOS 7.7 [server] v86.0.18

Here is a print of the log:

_Untitled-4.fw.png 2020-04-17 21.59.47.png

Thank you for your help
 

cPanelTJ

Product Owner
Staff member
Jan 29, 2019
97
49
93
Houston, TX
cPanel Access Level
Root Administrator
Twitter
@Ricardo Lobo

I am unable to replicate your issue on cPanel & WHM v86. Can you check if you have any standardized hooks registered to the Whostmgr Accounts::Create event?

You can check this in WHM Home > Development > Manage Hooks or over the command line with /usr/local/cpanel/bin/manage_hooks list
 
Last edited:
  • Like
Reactions: Ricardo Lobo

Ricardo Lobo

Member
Oct 11, 2016
23
2
3
Brazil
cPanel Access Level
Root Administrator
@Ricardo Lobo

I am unable to replicate your issue on cPanel & WHM v86. Can you check if you have any standardized hooks registered to the Whostmgr Accounts::Create event?

You can check this in WHM Home > Development > Manage Hooks or over the command line with /usr/local/cpanel/bin/manage_hooks list
@cPanelTJ

I see this jetbackup hook:

Code:
View/Edit Hook Details

Category: Whostmgr
Event: Accounts:: Create
Stage: post

This runs after an account is created.

Blocking is enabled for this stage. Hooks in this stage cannot prevent the event’s execution.

Hook:    /usr/bin/jetcli backup --hooks