[Bug 1423498] Re: FTP upload causes squid hang

Andreas Hasenack andreas at canonical.com
Thu Sep 28 19:21:11 UTC 2017

** Description changed:

+ [Impact] 
+ Uploading an empty file to an ftp server through the squid3 proxy hits an assertion error and the proxy crashes. It recovers after a few seconds.
+ The patch is applied upstream and basically adds to FTP the same checks
+ it already has for HTTP for this type of empty content.
+ [Test Case]
+ * deploy trusty on an lxd
+ * install packages:
+ $ sudo apt install squid3 proftpd-basic curl
+ * give the ubuntu user a password:
+ $ echo -e "ubuntu\nubuntu" | sudo passwd ubuntu
+ * create an empty file:
+ $ truncate -s 0 /tmp/zero
+ * try to upload it to the ubuntu user's home directory:
+ $ ftp_proxy=http://localhost:3128/ curl --upload-file /tmp/zero ftp://ubuntu:ubuntu@localhost/
+ On affected versions, that will return an error from curl:
+ curl: (52) Empty reply from server
+ The proxy cache.log file will show a crash and later restart on its own:
+ ==> /var/log/squid3/cache.log <==
+ 2017/09/28 18:01:47| assertion failed: Server.cc:244: "r->body_pipe != NULL"
+ [Regression Potential] 
+ The patch is focused, applied upstream for quite some time (since Dec 2013) and still present in trunk. I don't have other comments about the patch.
+ [Other Info]
+ I couldn't find a debian bug about this, and also didn't file one because debian no longer ships this old version of squid according to rmadison.
+ --------------------------------------------
  Ubuntu 14.04 LTS with recent updates.
  squid3 version 3.3.8-1ubuntu6.2
  If we try to upload file by FTP squid hangs and not responding anymore. Logs show the following:
  2015/02/19 10:52:19| assertion failed: Server.cc:244: "r->body_pipe != NULL"
  I have found that this bug was resolved in the recent versions but not yet applied for squid3 in Ubuntu repository:
  Could you apply the mentioned patch?
  Best regards,

You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to the bug report.

  FTP upload causes squid hang

To manage notifications about this bug go to:

More information about the Ubuntu-server-bugs mailing list