API call "addaddondomain" returning message that subdomain was removed?

appstacks

Registered
Dec 28, 2009
1
0
51
I have a WHM/CPanel Reseller installation and I can successfully create accounts, create databases, db users, etc using the respective APIs. But for some reason got stuck when trying to add a addon domain.

Can you review the output below and see if you have any ideas:

RAW API2 CALL:
Code:
<cpanelaction><module>AddonDomain</module><func>addaddondomain</func><args><dir>public_html/</dir><newdomain>hellothere3.com</newdomain><pass>welcome123</pass><subdomain>hello</subdomain></args></cpanelaction>

QUERY:
Code:
https://216.120.228.16:2087/xml-api/cpanel?user=cms16&xmlin=%3Ccpanelaction%3E%3Cmodule%3EAddonDomain%3C%2Fmodule%3E%3Cfunc%3Eaddaddondomain%3C%2Ffunc%3E%3Cargs%3E%3Cdir%3Epublic_html%2F%3C%2Fdir%3E%3Cnewdomain%3Ehellothere3.com%3C%2Fnewdomain%3E%3Cpass%3Ewelcome123%3C%2Fpass%3E%3Csubdomain%3Ehello%3C%2Fsubdomain%3E%3C%2Fargs%3E%3C%2Fcpanelaction%3E
RAW XML:

Code:
<cpanelresult>
    <apiversion>2</apiversion>
    <data>
      <reason>Removed hello.cms16.mydomainname.com Server at line: 16215.
Removed Entry from httpd.conf
Bind reloading on reseller13 using rndc zone: [cms16.mydomainname.com]
Bind reloading on ns2 using rndc zone: [cms16.mydomainname.com]

Bind reloading on ns1 using rndc zone: [cms16.mydomainname.com]

The subdomain, hello.cms16.mydomainname.com has been removed.</reason>
      <result>1</result>
    </data>
    <event>
      <result>1</result>
    </event>
    <func>addaddondomain</func>
    <module>AddonDomain</module>
  </cpanelresult>
I am trying to add a domain (and subdomain) and getting a message that the subdomain was removed. Any ideas?
 

MattDees

Well-Known Member
Apr 29, 2005
416
1
243
Houston, TX
cPanel Access Level
Root Administrator
I have a WHM/CPanel Reseller installation and I can successfully create accounts, create databases, db users, etc using the respective APIs. But for some reason got stuck when trying to add a addon domain.

Can you review the output below and see if you have any ideas:

RAW API2 CALL:
Code:
<cpanelaction><module>AddonDomain</module><func>addaddondomain</func><args><dir>public_html/</dir><newdomain>hellothere3.com</newdomain><pass>welcome123</pass><subdomain>hello</subdomain></args></cpanelaction>

QUERY:
Code:
https://216.120.228.16:2087/xml-api/cpanel?user=cms16&xmlin=%3Ccpanelaction%3E%3Cmodule%3EAddonDomain%3C%2Fmodule%3E%3Cfunc%3Eaddaddondomain%3C%2Ffunc%3E%3Cargs%3E%3Cdir%3Epublic_html%2F%3C%2Fdir%3E%3Cnewdomain%3Ehellothere3.com%3C%2Fnewdomain%3E%3Cpass%3Ewelcome123%3C%2Fpass%3E%3Csubdomain%3Ehello%3C%2Fsubdomain%3E%3C%2Fargs%3E%3C%2Fcpanelaction%3E
RAW XML:

Code:
<cpanelresult>
    <apiversion>2</apiversion>
    <data>
      <reason>Removed hello.cms16.mydomainname.com Server at line: 16215.
Removed Entry from httpd.conf
Bind reloading on reseller13 using rndc zone: [cms16.mydomainname.com]
Bind reloading on ns2 using rndc zone: [cms16.mydomainname.com]

Bind reloading on ns1 using rndc zone: [cms16.mydomainname.com]

The subdomain, hello.cms16.mydomainname.com has been removed.</reason>
      <result>1</result>
    </data>
    <event>
      <result>1</result>
    </event>
    <func>addaddondomain</func>
    <module>AddonDomain</module>
  </cpanelresult>
I am trying to add a domain (and subdomain) and getting a message that the subdomain was removed. Any ideas?
Could you please open a ticket on this issue? I'm not sure off hand what the issue is, however if you open a ticket, provide authentication information to your server and the EXACT call you are making (parameters and all) I can figure this out very quickly for you :)

tickets.cpanel.net/submit/

title it "ATTN: MattD API2 AddonDomain issues"
 

rlesterphx

Member
Jul 22, 2010
21
0
51
AddonDomain::addaddondomain removing instead of adding

I'm having the same issue.

I'm building a pretty complex app and part of it takes a domain name from a form field, sends it to another script with json, and uses the xmlapi to add it to the server as an addondomain.
I've been testing it with this one domain and it has been working fine, creating the subdomain and addon domain fine. Since I've been testing, I've been going into the cpanel GUI and deleting it so I can test again. But recently it started REMOVING it from the server every time I test, rather than creating the addon domain.

Here's an example of the API call:
Code:
$addon = json_decode($xmlapi->api2_query("sapphire", "AddonDomain", "addaddondomain", array(dir=>$dir, newdomain=>$domain2, pass=>$pass, subdomain=>$subd)), true);
So I can access the results like so:
Code:
$addon["cpanelresult"]["data"][0]["result"]
or
Code:
$addon["cpanelresult"]["data"][0]["reason"]
Like I said, before it was working fine and I was getting 1 for "result" and I could verify that it worked by checking in the GUI. But now I'm still getting 1 for "result" but it's trying to remove the domain instead, and this is the reason I get (with sensitive info x'd):
"Removed xxxxxx.xxxxxxx.com Server at line: 7133. Removed Entry from httpd.conf Bind reloading on xxxxx using rndc zone: [xxxxxx.com] Bind reloading on xxxxx using rndc zone: [xxxxxx.com] Error reloading bind on xxxxxx: rndc: connect failed: connection refused Bind reloading on washington using rndc zone: [xxxxxx.com] Bind reloading on adams using rndc zone: [xxxxxx.com] The subdomain, xxxxxxx.xxxxxx.com has been removed."
 

rlesterphx

Member
Jul 22, 2010
21
0
51
Figured it out

Just figured it out as I posted that...
The server still had an MX Entry for that domain. Once I deleted that it worked fine.
Strange that it was working before though without me having to delete that.