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.

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:
    1
    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
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    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
     
  3. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  4. ben-av

    ben-av Member

    Joined:
    Nov 10, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    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:
    1
    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