The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel API -- Create Domains -- No Errors Given

Discussion in 'cPanel Developers' started by xMarkPro, Jan 16, 2012.

  1. xMarkPro

    xMarkPro Registered

    Joined:
    Jan 16, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hey everyone,

    Sorry to waste your time, but small problem with the API, and not sure if it's a bug, or what have you. We sell a distributable software, and one aspect is that it communicates with cPanel API to automatically create addon domains. For the past ~6 weeks though, cPanel API seems to have quit giving errors.

    For example, properly formatted request to create an addon domain:

    ------------------------
    /xml-api/cpanel?user=XXXXXXXXX&xmlin=<cpanelaction><module>AddonDomain</module><func>addaddondomain</func><args><dir>/public_html/domains/matt.com</dir><newdomain>matt.com</newdomain><pass>ftjv48lnuU4</pass><subdomain>mattcom</subdomain></args></cpanelaction>
    ------------------------

    And the response:

    --------------------------
    <?xml version="1.0" ?>
    <cpanelresult>
    <apiversion>2</apiversion>
    <data>
    <reason>Deleted domain: mattcom.domain.com
    Bind reloading on server13 using rndc zone: [domain.com]
    The subdomain, mattcom.domain.com has been removed.</reason>
    <result>1</result>
    </data>
    <event>
    <result>1</result>
    </event>
    <func>addaddondomain</func>
    <module>AddonDomain</module>
    </cpanelresult>
    --------------------------

    First, domain wasn't added because it wasn't pointing to the proper nameservers, which is fine. However, issue is cPanel says the request was successful (result = 1), and for a reason says the domain was deleted. Is this how it's supposed to work? Shouldn't it give a failure result, then say the nameservers aren't pointing correctly, or no more addon domains can be created on this account, or whatever? Or is this maybe done on purpose for security reasons, or something?

    Any help would be greatly appreciated! It's creating a bit of a support headache on our end, since the cPanel API says the request was successful when it wasn't.

    PS. This is not an isolated incident, and happens all the time on many different servers / networks / hosting companies. If I remember correctly though, about 6 or 8 weeks ago the API would give off proper error responses.
     
  2. BlaineM.

    BlaineM. cPanel QA Analyst
    Staff Member

    Joined:
    Apr 4, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Greetings Mark,

    I'm putting together a response to your ticket right now. Thanks for your patience.
     
  3. LaceHost-Ishan

    LaceHost-Ishan Active Member

    Joined:
    Dec 6, 2008
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Pune, India
    cPanel Access Level:
    DataCenter Provider
    Hello,
    I am facing the same issue. Has this been fixed ?
     
  4. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    This is a bug in cPanel based on their error reporting code. The addaddondomain() function fails but then the function to remove the subdomain succeeds and only the output of the last function is reported via the API. There are a couple of tickets in on this issue and a feature request.

    Until it is fixed, you can listaddondomains() to check if the addon was actually added as the output from addaddondomain().
     
  5. vimalkumar_k

    vimalkumar_k Member

    Joined:
    Feb 24, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Has this issue with addaddondomain been fixed?
     
Loading...

Share This Page