AddonDomain::addaddondomain API Version 2, won't add a domain, keeps deleting it.

Dekken

Registered
Mar 15, 2013
1
0
1
cPanel Access Level
Website Owner
Hello,

So I seem to be having some troubles with the AddonDomain::addaddondomain function.
This is how I call it:

PHP:
api2_query($this->cpanelUser, "AddonDomain", "addaddondomain", array('dir' => $this->dir, 'subdomain' => $this->subdomain, 'domain' => $this->domain);
And the error that I get is:
Code:
  <cpanelresult>
    <apiversion>2</apiversion>
    <data>
      <reason>Deleted domain: sub.domain.com
Bind reloading on marge using rndc zone: [domain.com]
The subdomain, sub.domain.com has been removed.</reason>
      <result>1</result>
    </data>
    <event>
      <result>1</result>
    </event>
    <func>addaddondomain</func>
    <module>AddonDomain</module>
  </cpanelresult>
A folder is being created in the public_html direcotry, but nothing else.
I am able to call other functions like delete and list just fine, but this one seems to be causing problems.
I have searched all over the place and could not find a valid solution.

Thanks!
 

adman_9000

Registered
Apr 19, 2013
1
0
1
cPanel Access Level
Root Administrator
Hi,

I have the same problem. The only solution I have found by googling does not apply to me but it may work for you..

You are trying to add a domain which does not resolve to your server and do not have the correct settings to allow this in WHM (Tweak settings -> Domains -> Allow Remote Domains). It is therefore adding the domain, finding it doesn't resolve to your server and removing it.

As I say this is the only solution I have found but in my case I have this setting turned on as well as having the add-on domain and subdomain resolve to my server and am still getting the error..


<cpanelresult>
<apiversion>2</apiversion>
<data>
<reason>Deleted domain: sub.main-domain.com
Bind reloading on myserver1 using rndc zone: [main-domain.com]
The subdomain, sub.main-domain.com has been removed.</reason>
<result>1</result>
</data>
<event>
<result>1</result>
</event>
<func>addaddondomain</func>
<module>AddonDomain</module>
</cpanelresult>


The subdomain variable is sent as 'sub', it only returns the full subdomain in the error.