Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

XMLAPI (PHP) Error - Can't add new MX

Discussion in 'cPanel Developers' started by ben-av, Jun 9, 2010.

  1. ben-av

    ben-av Member

    Joined:
    Nov 10, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    151
    I have a DNS zone editor in our domain management system for customers to use, but at the moment I'm not able to add MX records

    Parameters being passed in
    [zone] =>
    [ttl] => 14400
    [class] => IN
    [preference] =>
    [exchange] =>

    (Obviously with values filled in)

    Results come back as:
    Code:
        [result] => SimpleXMLElement Object
            (
                [status] => 0
                [statusmsg] => Failed to serialize record: unknown error
            )
    
    Does anyone any thoughts/suggestions as to what is wrong? A-Records/CNAMEs etc are all fine - MX is the only one with problems

    Ben
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    3
    Trophy Points:
    68
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Ben,

    Could you provide a example URL that you system is making?

    If you're using the XMLAPI PHP client class, you can get that info in debug mode ($xmlapi->set_debug(1); ). Or if you could provide the snippet of code that performs this query. Essentially, I need to know the exact call you're requesting against the xml-api binary, not just the parameters.

    Regards,
    -DavidN
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. ben-av

    ben-av Member

    Joined:
    Nov 10, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    151
    Is the http request/post data suitable? That shows the details I think you're looking for

    Code:
    ]14831][06/10/2010:17:12:28 -0000][getreq 1]: [POST /xml-api/addzonerecord HTTP/1.1
    [14831][06/10/2010:17:12:28 -0000][headerparser 1]:Host: 192.168.0.144:2087
    [14831][06/10/2010:17:12:28 -0000][headerparser 1]:Accept: */*
    [14831][06/10/2010:17:12:28 -0000][headerparser 1]:Authorization: Basic ***************************
    [14831][06/10/2010:17:12:28 -0000][headerparser 1]:Content-Type: application/x-www-form-urlencoded
    [14831][06/10/2010:17:12:28 -0000][headerparser 1]:Content-Length: 71
    [14831][06/10/2010:17:12:28 -0000][processformdata 1]: zone=testdomain.com&ttl=14400&class=IN&preference=10&exchange=newmx.com
    [14831][06/10/2010:17:12:28 -0000][killconnection 1]
    [14831][06/10/2010:17:12:28 -0000][killconnection exit 1]
    
    Enabled debug but never got any output (not 100% sure why but haven't look into it, and that was quicker)

    Produces same error as before. Hopefully I'm not doing something stupid, would never forgive myself
     
  5. ben-av

    ben-av Member

    Joined:
    Nov 10, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    151
    Ok, I do now feel stupid.
    For some bizarre reason (for which I still don't know) the type parameter wasn't being passed on IF the type was a MX.

    Consider this fixed :rolleyes:
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice