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.

restorepkg creates empty dns zone file

Discussion in 'Bind / DNS / Nameserver Issues' started by tylerl, Aug 23, 2011.

  1. tylerl

    tylerl Active Member

    Joined:
    Dec 11, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Note: If this is already discussed in another thread, please point me to it -- i searched and couldn't find anything.

    Using a server with a FRESH INSTALL of the latest stable release (WHM 11.30.2 (build 1) on Centos 5.6 on x64), the package restore functionality seems to be creating emptyDNS zone files. I first noticed the problem while using the multiple-account transfer tool from another domain, but since then I've narrowed the problem down to the restore process.

    From the old server, if I use pkgacct to create a backup for the domain, I can verify that the backup contains an intact and complete zone file in the dnszones directory. Restoring the package on my new (fresh) server places into /var/named a zone file containing nothing other than the first line (the comment line identifying the cpanel version:

    Code:
    ; cPanel first:11.30.2.1 (update_time):1314144608 Cpanel::ZoneFile::VERSION:1.3 hostname:oldserver.com latest:11.30.2.1
    
    Restoring the account onto another older cpanel server (which has recently been updated to 11.30.2.1 on Centos 5.6 on x64 -- exact same version) yields a perfectly working DNS zone.

    So there's something broken with the new server. How do I identify or work around this?
     
  2. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Are DNS zone templates in WHM under "DNS Functions > Edit Zone Templates" intact.

     
  3. tylerl

    tylerl Active Member

    Joined:
    Dec 11, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Unfortunately, yes. That is all intact and correctly working.

    Note that zone file creation works correctly when a new account is set up. It's restoring backed-up packages (with their account-specific zone files, not template-driven) that is broken. The problem, I would guess, is that when the IP translation is applied to the zone file to make it correct for the new server, some error is causing the resultant content to be lost, resulting in an empty file.
     
    #3 tylerl, Aug 24, 2011
    Last edited: Aug 24, 2011
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Are any errors outputting to /usr/local/cpanel/logs/error_log location upon restoring the account on the non-working new server?

    Next, is the zone template properly setup on that machine? It could be the zone template that is the issue, since restored accounts will use the zone template if they have a differing A record IP for the main domain in the backup than an existing IP on the new machine.
     
  5. tylerl

    tylerl Active Member

    Joined:
    Dec 11, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Here's the output of error_log produced during a restorepkg

    Code:
    [2011-08-24 14:34:26 -0500] info [whostmgr5] Data file '/var/cpanel/deleteddomains.yaml' does not exist or is empty, correcting.
    [2011-08-24 14:34:32 -0500] info [whostmgr5] [checkmx] mydomain.com (19 in mydomain.com) resolved to 99.99.99.99 (local)
    [2011-08-24 14:34:32 -0500] info [whostmgr5] [checkmx] auto detect is possible
    cphulkd rejected registration attempt for whostmgrd with: 500 AUTH FAILED
    
    That last line is probably not relevant. The zone templates appear to be intact.

    EDIT
    After I ran this test, I checked the DNS records... and the problem wasn't present there. I'm doing further tests to see if it has resolved itself. Not sure if I should be happy or worried if that is the case.
     
    #5 tylerl, Aug 24, 2011
    Last edited: Aug 24, 2011
  6. tylerl

    tylerl Active Member

    Joined:
    Dec 11, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    OK, I ran some more transfers, and I think I found the culprit:

    Code:
    [2011-08-24 14:56:02 -0500] warn [swapip] Error while parsing zonedata for mydomain.com: expected valid serial, line 4
        ...propagated at /usr/local/cpanel/Cpanel/CPAN/Net/DNS/ZoneFile/Fast.pm line 152.
     at /usr/local/cpanel/Cpanel/ZoneFile.pm line 53
        Cpanel::ZoneFile::new('Cpanel::ZoneFile', 'text', ARRAY(0x105282f0), 'domain', 'mydomain.com') called at bin/swapip line 120
        bin::swapip::_changezones(HASH(0xa481a0), ARRAY(0xa48080), ARRAY(0x10555490), '99.99.99.99', undef, HASH(0x10528310), 1, 0) called at bin/swapip line 78
        bin::swapip::script('bin::swapip', '--storable') called at bin/swapip line 23
    So apparently it will only fail with certain zone files. I'll check to see how the serial differs. Still, an unrecognized serial shouldn't result in this mess.
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    When you have the information on what line 4 for that zone shows for us to compare to a working one, please let us know the results. I'm pretty interested in what it could have to create that error.
     
  8. tylerl

    tylerl Active Member

    Joined:
    Dec 11, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Argh. This is frustrating.

    The file doesn't look any different than any other. What's more, manually running the offending file though Cpanel::CPAN::Net::DNS::ZoneFile::Fast.parse() works just fine with no failures.

    I attempted to work around the problem by setting up a completely NEW server, with no association with the old, and the same problem appears still on the new server.

    I'd like to rule out the possibility that the script isn't failing somewhere upstream and perhaps attempting to parse something *other* than the zone file. My original plan was to modify Cpanel/ZoneFile.pm to dump the contents of ${opts}{'text'} into a temp file so that I could see exactly what text it was examining. But for some reason, the server doesn't appear to run my modified code.

    What a mess.
     
  9. tylerl

    tylerl Active Member

    Joined:
    Dec 11, 2009
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
Loading...
Similar Threads - restorepkg creates empty
  1. oldchili
    Replies:
    3
    Views:
    228

Share This Page