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.

cpbackup connects to FTP server but connection times-out...

Discussion in 'Data Protection' started by betoranaldi, Mar 9, 2010.

  1. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I have had cpbackup up and running for a few years without any problems. all of a sudden no backups are being transfered to the remote ftp.

    Nothing has changed on this remote ftp server.

    Looking at the backup log I get the following lines:

    Code:
    Net::FTP=GLOB(0x000db000)<<< 250 OK. Current directory is /cpbackup/daily
    Net::FTP=GLOB(0x000db000)>>> ALLO 173072330
    Net::FTP=GLOB(0x000db000)<<< 200 PORT command successful
    Net::FTP=GLOB(0x000db000)>>> STOR user.tar.gz
    Net::FTP=GLOB(0x000db000): Timeout at /scripts/cpbackup line 764
    Net::FTP=GLOB(0x000db000)>>> QUIT
    Net::FTP=GLOB(0x000db000): Timeout at /scripts/cpbackup line 765
    This happens with all users on this cpanel installation. Anyone have any ideas?
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Please toggle the passive mode option in the backup configuration, and then force cpbackup to run once more; immediately following the command please use "tail -f" to follow and watch the cpbackup log file:
    Code:
    # /scripts/cpbackup --force
    If there is a firewall on either of the two servers, please temporarily disable both firewalls while cpbackup is running to ensure they are not interfering.

    To further clarify, the FTP passive mode option for cpbackup is found at the following menu path (via WHM) and is labeled as seen below:
    WHM: Main >> Backup >> Configure Backup
    FTP Backup Passive Mode (required if you are behind a firewall or FTP backups fail)
     
  3. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I followed the directions. It's set to passive and there are no firewall problems.

    Now it backed up 3 accounts but all other accounts get the following error:

    Code:
    Net::FTP=GLOB(0xd489f28)>>> STOR user.tar.gz
    Net::FTP=GLOB(0xd489f28): Timeout at /scripts/cpbackup line 764
    Net::FTP=GLOB(0xd489f28)>>> QUIT
    Net::FTP=GLOB(0xd489f28): Timeout at /scripts/cpbackup line 765
    
    What would cause the script to timeout?

    There are plenty of resources on this VPS
     
  4. betoranaldi

    betoranaldi Well-Known Member

    Joined:
    Dec 5, 2007
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Is there anyway to reset everything? only a few backups actually upload to the server. everything else times out.
     
  5. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    I continue this thread since I have exactly the same problem with /scripts/cpbackup since yesterday.
    I did not change anything in the configuration.
    The logfile says (for all cpanel accounts)
    Net::FTP=GLOB(0x1fd3f898)>>> STOR cpaccount.tar.gz
    Net::FTP=GLOB(0x1fd3f898): Timeout at /scripts/cpbackup line 764
    Net::FTP=GLOB(0x1fd3f898)>>> QUIT
    Net::FTP=GLOB(0x1fd3f898): Timeout at /scripts/cpbackup line 765

    the lines in the cpbackup perl-file that raise the timeout are
    $ftp->put( $targetfile, $remotefile );
    $ftp->quit;

    that means, connection to the remote backup server opens fine, even the cpaccount.tar.gz file is created but then the upload procedure is blocked by something.

    Can anyone help me to trace down this odd failure?
     
    #5 zombo, Sep 23, 2010
    Last edited: Sep 23, 2010
  6. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    As mentioned earlier in this thread, please toggle the FTP Backup Passive Mode option; this may help workaround connectivity issues that could cause the timeout to occur.
     
  7. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    WHM recommends to enable FTP Backup Passive Mode, if you are behind a firewall or FTP backups fail.

    I had enabled PASV passive mode and all backups failed since 3 days.
    I am behind a csf/lfd firewall and all necessary ports are open.
    Now I toogled as you recommended and disabled passive mode.

    That is following your advice and against the WHM recommendation.
    Then I did a /scripts/cpbackup --force
    and now 12 of my 18 accounts are backed up correctly while 6 again did timeout. Those 6 are small accounts. Has my vps gone mad?
    :confused:
     
  8. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Thank you for the information. What is your cPanel version number?

    In the server firewall configuration, if it's not already setup like this, please white-list the IP address of the FTP server for both inbound and outbound traffic.
     
  9. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    I use WHM 11.26.8 and the latest csf/lfd.

    I have added to csf.allow
    n.n.n.1 # Manually allowed - Fri Sep 24 21:52:56 2010 (my ftp 1st)
    n.n.n.2 # Manually allowed - Fri Sep 24 21:53:55 2010 (my ftp 2nd)
    where n.n.n.n are the ip's of my ftp service

    actually, I guess the csf rules should be written
    tcp: in:d=21:s=n.n.n.1
    tcp: out:d=21:s=n.n.n.2
    tcp: in:d=49000-59000:s=n.n.n.1
    tcp: out:d=49000-59000:s=n.n.n.2
    since I do not want to give the ftp service access to non-ftp ports
    I have to study the manuals here ... rtfm :)

    I will try with PASV mode and without PASV mode and will report later.
     
  10. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    Now, this was quite a time consuming puzzle but after all I am glad I could resolve it myself.

    My ftphost has a load balancer that resolves to 2 different IPs (what can be seen by calling #dig ftp.[myftphost].com where myftphost has to be the correct ftp domain).

    I have put ......|d={port number...}|s=ftp.[myftphost].com into the csf.dyndns file but the dyndns feature of the csf/lfd firewall opens only one of the two associated IPs. Since the load balancer tried to handle the transfer on both IPs a couple of cPanel accounts always timed out.

    The final solution was to allow ports 20, 21 and e.g. 49000-59000 for both IPs that my ftpservice uses in the csf.allow file.

    Problem solved. Thanks for your attention anyway.
     
  11. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Zombo, thank you for sharing the information about your solution. I'm sure others will find it helpful. :)
     
Loading...

Share This Page