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.

ftp timeout issues

Discussion in 'General Discussion' started by Secret Agent, Feb 8, 2005.

  1. Secret Agent

    Secret Agent Guest

    I have a frustrating FTP problem. I've tried two FTP clients on my cable LAN connection (very speedy). I tried CoreFTP and FileZilla both same so its not my end. My actual hosting server has some sort of FTP timeout issue.

    I've tried ProFTPd and PureFTPd. Every time I upload many smaller files at once I get disconnected within seconds. If I upload large files I do not get disconnected. I'm using APF firewall but that never caused an issue in the past and the port is not blocked either. How do I go around fixing this? I'm the only one on this server too.

    I've tried search for the ftp config files but honestly found nothing (according to other threads' suggestions on this forum)
     
  2. Secret Agent

    Secret Agent Guest

    Steps taken:

    /scripts/ftpup --force

    Switch (in whm) from pure to pro and back to pure (tested both, same issues).

    Only conf files in /etc is pure-ftpd.conf (not pureftpd.conf) and yet no "timeout" line in that file at all to edit.

    Please help. I know its the server not the connection on my end.

    Just a note, I do have APF and BFD installed (default config with port 21 open).

    I can connect to ftp fine, but it just times out after about 15 seconds or when uploading or downloading several files.

    For sake of sharing, on my end I'm on XP Home, Linksys router with its built in firewall (xp firewall too). I've tried both passive on and off, same thing.

    Not sure if maxidletime in pure-ftpd.conf is the same thing but right now its on 15 for me.
     
    #2 Secret Agent, Feb 9, 2005
    Last edited by a moderator: Feb 9, 2005
  3. Secret Agent

    Secret Agent Guest

    Here's a bit of ftp log during my session...

    Status: Connecting to mydomain.com ...
    Status: Connected with mydomain.com. Waiting for welcome message...
    Response: 421 Too many connections (8) from this IP
    Error: Disconnected from server
    Error: Unable to connect!


    I upped the maxidletime to 60 in pure-ftpd.conf (before I got the above usual error).

    How do I correct this? Thanks in advance to any that help

    Note: I changed the "MaxClientsPerIP" from 8 to 30 (only because this server is solely for me no one else). However, what would be suitable number or another workaround to this on a web hosting server?
     
    #3 Secret Agent, Feb 9, 2005
    Last edited by a moderator: Feb 9, 2005
  4. Secret Agent

    Secret Agent Guest

    ongoing ftp issues.

    Still having trouble again. This is really aggravating me.

    Update on my specs....

    WHM 10.x Current
    Pure FTP
    APF Firewall
    mod_dosevasive
    mod_security

    I am still having issues with FTP uploads --- same symptoms. About 1.5 – 2.5 MB into the upload, the server glitches-out with an error:

    hResRead: 0, hResWrite:80042003

    Before, with Pro FTP server installed, there was a refusal to resynch an upload file upon reconnect. However, Pure FTP server is now allowing resynch and reconnect, but about every 1.5-2.5 MB upload, there is a write fault at the server. This leads to disconnect, reconnect and resych which causes a very slow overall transfers.

    Perhaps ClamAV interrupts while still filling the scan cache/buffer, and this causes the glitch. I just can't track this down at all.

    This is my APF config

    Code:
    # Common ingress (inbound) TCP ports -3000_3500 = passive port range for Pure FTPD
    IG_TCP_CPORTS="21,22,25,53,80,110,143,443,2082,2083, 2086,2087, 2095, 2096,3000_3500"
    #
    # Common ingress (inbound) UDP ports
    IG_UDP_CPORTS="53"
    
    # Common egress (outbound) TCP ports
    EG_TCP_CPORTS="21,25,80,443,43,2089"
    #
    # Common egress (outbound) UDP ports
    EG_UDP_CPORTS="20,21,53"
    
    This is /var/log/messsages (grep user)
    Code:
    Apr  4 21:16:40 server PAM_pwdb[5256]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 21:20:05 server PAM_pwdb[24507]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 21:21:07 server PAM_pwdb[27288]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 21:21:49 server PAM_pwdb[28157]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 21:26:27 server PAM_pwdb[3005]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 21:52:10 server PAM_pwdb[30951]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 21:57:09 server PAM_pwdb[32368]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:09:57 server PAM_pwdb[3999]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:10:01 server PAM_pwdb[4326]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:10:01 server PAM_pwdb[4327]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:10:02 server PAM_pwdb[4370]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:10:02 server PAM_pwdb[4384]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:10:03 server PAM_pwdb[4434]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:35:16 server PAM_pwdb[26568]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:35:17 server PAM_pwdb[26608]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:35:17 server PAM_pwdb[26609]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:35:20 server PAM_pwdb[26907]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:35:21 server PAM_pwdb[26917]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:37:21 server PAM_pwdb[1928]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:43:09 server PAM_pwdb[8735]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:43:09 server PAM_pwdb[8736]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:43:10 server PAM_pwdb[8738]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:43:10 server PAM_pwdb[8739]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:43:11 server PAM_pwdb[8740]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:43:18 server PAM_pwdb[8771]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:48:34 server PAM_pwdb[10216]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 22:59:14 server PAM_pwdb[12110]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 23:00:17 server PAM_pwdb[12958]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 23:07:46 server PAM_pwdb[14033]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 23:08:01 server PAM_pwdb[14077]: (ftp) session opened for user theusername by (uid=0)
    Apr  4 23:23:37 server PAM_pwdb[18877]: (ftp) session opened for user theusername by (uid=0)
    Apr  6 00:19:09 server pure-ftpd: (?@xx.x.132.115) [INFO] theusername is now logged in
    Apr  6 00:25:20 server pure-ftpd: (theusername@xx.x.132.115) [INFO] Timeout (no new data for 900 seconds)
    Apr  6 00:42:56 server pure-ftpd: (?@xx.x.132.115) [INFO] theusername is now logged in
    Apr  6 00:44:03 server pure-ftpd: (theusername@xx.x.132.115) [NOTICE] /home/theusername//public_html/site/BK950064.pdf downloaded  (138123 bytes, 662.35KB/sec)
    Apr  6 00:44:19 server pure-ftpd: (theusername@xx.x.132.115) [NOTICE] /home/theusername//public_html/site/BK950064.pdf downloaded  (138123 bytes, 567.04KB/sec)
    Apr  6 00:44:56 server pure-ftpd: (theusername@xx.x.132.115) [INFO] Logout.
    Apr  6 21:15:34 server pure-ftpd: (?@xx.x.132.115) [INFO] theusername is now logged in
    Apr  6 21:15:38 server pure-ftpd: (?@xx.x.132.115) [INFO] theusername is now logged in
    Apr  6 21:15:46 server pure-ftpd: (theusername@xx.x.132.115) [INFO] Logout.
    Apr  6 21:30:38 server pure-ftpd: (theusername@xx.x.132.115) [INFO] Timeout - try typing a little faster next time
    Apr  6 21:39:23 server pure-ftpd: (?@xx.x.132.115) [INFO] theusername is now logged in
    Apr  6 21:44:11 server pure-ftpd: (theusername@xx.x.132.115) [INFO] Timeout (no new data for 900 seconds)
    Apr  6 21:44:12 server pure-ftpd: (?@xx.x.132.115) [INFO] theusername is now logged in
    Apr  6 21:44:12 server pure-ftpd: (theusername@xx.x.132.115) [NOTICE] Restarting at 1515520
    Apr  6 21:47:53 server pure-ftpd: (theusername@xx.x.132.115) [INFO] Timeout (no new data for 900 seconds)
    Apr  6 21:47:54 server pure-ftpd: (?@xx.x.132.115) [INFO] theusername is now logged in
    Apr  6 21:47:54 server pure-ftpd: (theusername@xx.x.132.115) [NOTICE] Restarting at 4292608
    Apr  6 21:47:57 server pure-ftpd: (theusername@xx.x.132.115) [NOTICE] /home/theusername//.spamassassin/user_prefs uploaded  (287385 bytes, 90.30KB/sec)
    Apr  6 22:02:57 server pure-ftpd: (theusername@xx.x.132.115) [INFO] Timeout - try typing a little faster next time
    Apr  6 22:28:52 server pure-ftpd: (?@xx.x.132.115) [INFO] theusername is now logged in
    Apr  6 22:29:26 server pure-ftpd: (theusername@xx.x.132.115) [NOTICE] /home/theusername//mail/thedomain.com/mike/inbox uploaded  (1178318 bytes, 90.06KB/sec)
    
    This is my entire /etc/pure-ftpd.conf file attached.

    I've browsed the forums left and right and just can't seem to get a fix here.

    I hope someone can help.
     

    Attached Files:

  5. Secret Agent

    Secret Agent Guest

    This is the ftp log as well.

    TYPE I
    200 TYPE is now 8-bit binary
    PASV
    227 Entering Passive Mode (xx,x,179,254,48,127)
    connecting data channel to xx,x.179.254:48,127(12415)
    data channel connected to xx,x.179.254:48,127(12415)
    STOR user_prefs
    150 Accepted data connection
    hResRead: 0, hResWrite:80042003
    Error reading response from server.
    transferred 3416064 bytes in 228.828 seconds, 116.629 Kbps ( 14.579 Kbps), transfer failed.
    It appears that the connection is dead. Attempting reconnect...
    Connecting to xx,x.179.254:21
    Connected to xx,x.179.254:21 in 0.015625 seconds, Waiting for Server Response
    220---------- Welcome to Pure-FTPd [TLS] ----------
    220-You are user number 1 of 50 allowed.
    220-Local time is now 22:44. Server port: 21.
    220-IPv6 connections are also welcome on this server.
    220 You will be disconnected after 15 minutes of inactivity.
    Host type (1): Automatic Detect
    USER jschwoeb
    331 User jschwoeb OK. Password required
    PASS (hidden)
    230-User jschwoeb has group access to: jschwoeb
    230 OK. Current restricted directory is /
    SYST
    215 UNIX Type: L8
    Host type (2): Unix (Standard)
    PWD
    257 "/" is your current location
    CWD .spamassassin
    250 OK. Current directory is /.spamassassin
    New connection OK. Reissuing command.
    TYPE I
    200 TYPE is now 8-bit binary
    PASV
    227 Entering Passive Mode (xx,x,179,254,183,169)
    connecting data channel to xx,x.179.254:183,169(47017)
    data channel connected to xx,x.179.254:183,169(47017)
    REST 3416064
    350 Restarting at 3416064
    STOR user_prefs
    150 Accepted data connection
    226-File successfully transferred
    226 12.621 seconds (measured here), 90.06 Kbytes per second
    transferred 1163929 bytes in 12.625 seconds, 720.253 Kbps ( 90.032 Kbps), transfer Succeeded.
    Transfer request completed with status: Finished
    PWD
    257 "/.spamassassin" is your current location
    TYPE A
    200 TYPE is now ASCII
    PASV
    227 Entering Passive Mode (xx,x,179,254,79,241)
    connecting data channel to xx,x.179.254:79,241(20465)
    data channel connected to xx,x.179.254:79,241(20465)
    LIST
    150 Accepted data connection
    transferred 466 bytes in < 0.001 seconds, 3640.625 Kbps ( 455.078 Kbps), transfer succeeded.
    226-Options: -a -l
    226 7 matches total

    The file eventually transfers (in this case), but the fault/restart causes a long delay. A file upload that should take about 2-3 minutes is taking about 10-15 minutes.

    It is always the same write error hResWrite:80042003 leading to the same Error reading response from server..
     
  6. NNNils

    NNNils Well-Known Member

    Joined:
    Sep 17, 2002
    Messages:
    580
    Likes Received:
    0
    Trophy Points:
    16
    We have a similar problem here, customer using cuteftp gets disconnected after exactly 20 minutes. Max idle time already upgraded from 15 minutes to 60 minutes, which has no effect.

    Did you ever find a solution?
     
  7. deadsoulz

    deadsoulz Member

    Joined:
    Mar 2, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    We are seeing same issues here, A Solution would be nice!
     
  8. hergy80

    hergy80 Well-Known Member

    Joined:
    Sep 4, 2004
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    I had the same problem and then realized it was because of APF and Passive Ports.

    We were using PASV connections and didn't have the passive ports opened in APF. It would somehow start the file, then drop the connection after a few seconds (I don't know why it even started, but I've done this on 2 different servers now).

    So I would check the pure-ftpd.conf file, set the Passive Port range to whatever, and then open those ports in APF and see if it works.
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    APF should not need any ports open for PASV connections as it's an SPI firewall (I never open ephemeral ports in APF with either pro or pure ftpd). If it works for you, fine, just be aware that by doing so you're breaking the SPI part of the firewall and converting it to effectively a static firewall, which is less secure.
     
  10. hergy80

    hergy80 Well-Known Member

    Joined:
    Sep 4, 2004
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    After looking at your pure-ftpd.conf file you posted (sorry I didn't see it earlier) You don't have the passive port ranges set, and based on your FTP log, you are using PASV mode, that's probably the problem.

    Uncomment your passive port range, and then add that range to apf and see if it works.
     
  11. hergy80

    hergy80 Well-Known Member

    Joined:
    Sep 4, 2004
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    Chirpy, could there be another setting in APF that would cause this to fix the problem? I've done this on 2 servers, one with Cpanel and one without a CP, both experienced the same problem and after it fixed it.. I'm not too entirely familiar wtih the inner workings of APF..
     
  12. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    What you're doing may be the only solution - I just wanted to make clear the consequences :)

    There are bugs in the current version of APF which I have seen with clients and a lot revolve around FTP, though some are to do with POP3,a nd others. Opening the hole in the firewall may be the only solution if you use tha firewall until they come out with a (apparently impending fix). The alternative is to use a different firewall script, such as KissMyFirewall which I have used with great success on servers where APF has been unreliable.
     
  13. deadsoulz

    deadsoulz Member

    Joined:
    Mar 2, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Would it still be APF problem even if it times out exactly 15 minutes every time?
     
  14. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I wouldn't have thought so. That sounds more like a timeout either by an ISP, or within the ftp daemon configuration file (or indeed, the FTP client).
     
  15. hergy80

    hergy80 Well-Known Member

    Joined:
    Sep 4, 2004
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    I looked on the pureftp faq and found this article. I don't have a lot of knowledge of firewall filtering besides what would be considered a static firewall, so maybe someone else might be able to see if this could be the timeout problems:


    Since APF allows Type 3 icmp (Desintation Unreachable) in by default, would allowing Type 4 (Source Quench) in maybe fix the proble as is mentioned in the second paragraph?
     
    #15 hergy80, Aug 19, 2005
    Last edited: Aug 19, 2005
  16. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    I have this same problem, but it's really hard to reproduce.

    I can download a 90mb file with FTP on my (high quality) ISP. My customers, on a low quality ISP, cannot download the same file - it bombs midway, no matter how many times they try. Sometimes they can't even login to FTP.

    If APF isn't passing Source Quench, that could well provide a fix couldn't it? Has anyone worked out the APF config changes for passing Source Quench?
     
  17. adept2003

    adept2003 Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    283
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    ~ "/(extra|special)/data"
    If ftp is working fine for faster isp connections, yet produces a 423 error for the slower ones, then modify the ftp client timeout settings, rather than the pure-ftp settings. i.e. If the ftp client settings are to timeout after 30 secs, but pure ftp says 60 secs, then the ftp client will try connecting again before the connection is released by the server, hence the "too many connections from this ip" message.

    Set the client ftp program timeout to a higher value. eg. http://filezilla.sourceforge.net/documentation/connection.htm
     
    #17 adept2003, Aug 20, 2005
    Last edited: Aug 20, 2005
  18. Xenon101

    Xenon101 Well-Known Member

    Joined:
    Mar 13, 2005
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    6
    I'm having timeout issues too, however im not using a firewall at all! I've put off rolling out clients to this machine for days while trying to find a fix with no luck, what could be causing this?
     
  19. nerdzoll

    nerdzoll Well-Known Member

    Joined:
    Oct 4, 2004
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    I had this issue.. here is a fix...

    Hey guys,
    I was having a similar error quite a while ago. There was only one person on the planet who could help me and by gosh it worked.
    Check out this from the Fedora Mailing List, (this is the response he gave me however hopefully it might work for you too). Let me know if it works.
    Cheers
    Stuart

    Damn.. link did not work.. here it is as plain text... just remove the $ signs, for some reason the link kept shortening....
    $https$://www.redhat.com/archives/fedora-list/2005-July/msg05454.html
     
    #19 nerdzoll, Oct 6, 2005
    Last edited: Oct 6, 2005
  20. wozza

    wozza Member

    Joined:
    Feb 14, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    apf causing ftp to timeout

    we have the latest version of apf (0.9.6-1)

    seems that the new rules in /etc/apf/bt.rules ( some new imcp rules in there ) , cause problems with ftp timeouts for users.
    quick fix

    cd /etc/apf
    mv bt.rules bt.rules-
    apf -r

    ( ignore this echo'd message ( /etc/apf/firewall: line 147: /etc/apf/bt.rules: No such file or directory )

    note: bt.rules gets installed with installation or upgrade , so it may appear again if upgraded.
     
Loading...

Share This Page