1

I install ProFTP from apt on fresh ubuntu 14.04 (OpenSSH+LAMP) with mod-sql for user login. I set ftp folder for each user from config in sql table. And allow user to resume upload file by set AllowStoreRestart on in configuration.

Everything work fine. User can upload/download manage file in their folder. If user stop upload queue in filezilla they can resume it later.

However, when internet connection not stable on client side. After internet connection down, sometime file that still uploading are disappear from a folder on server.

After investigation, I found that all file that disappear got error like this

[13/Jul/2014:14:15:37 +0000] 110.xx.xx.xx username STOR  426  2196991 788.205 Timeout exceeded: TimeoutStalled during data transfer  failed Data connection closed

or

[13/Jul/2014:14:11:48 +0000] 110.xx.xx.xx username STOR  426  675945 211.340 Read EOF from client  failed Data connection closed

Then, this file will disappear from folder and filezilla will try to upload from first byte again. I recheck xferlog and didn't found any delete request from client just incomplete upload message.

  • Does anyone know why partially uploaded file disappear from upload folder?
  • How to prevent this behavior of proftpd?

Server version

# proftpd -v
ProFTPD Version 1.3.5rc3
# uname -a
Linux testftp 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 21:40:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
# mysql -V
mysql  Ver 14.14 Distrib 5.5.37, for debian-linux-gnu (x86_64) using readline 6.3

proftpd.conf

Include /etc/proftpd/modules.conf
UseIPv6                         on
IdentLookups                    off
ServerName                      "Debian"
ServerType                      standalone
DeferWelcome                    off
MultilineRFC2228                on
DefaultServer                   on
ShowSymlinks                    on
TimeoutNoTransfer               600
TimeoutStalled                  600
TimeoutIdle                     1200
DisplayLogin                    welcome.msg
DisplayChdir                    .message true
ListOptions                     "-l"
DenyFilter                      \*.*/
RootLogin                       off
DefaultRoot                     ~
RequireValidShell               off
Port                            21
<IfModule mod_dynmasq.c>
</IfModule>
MaxInstances                    30
User                            proftpd
Group                           nogroup
Umask                           022  022
AllowOverwrite                  on
TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log
<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>
<IfModule mod_ratio.c>
Ratios off
</IfModule>
<IfModule mod_delay.c>
DelayEngine on
</IfModule>
<IfModule mod_ctrls.c>
ControlsEngine        off
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>
<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>
Include /etc/proftpd/sql.conf
AllowStoreRestart on
Include /etc/proftpd/conf.d/

P.S.

  • Normally, Files that transfer to this server are more than 5GB.
masegaloeh
  • 18,236
  • 10
  • 57
  • 106
Pattapong J
  • 151
  • 6

1 Answers1

2

After a lot of research and testing. The culprit is AppArmor. Normally, It work just fine. Only some condition occur that AppArmor sometimes delete a file from broken connection. I couldn't find the specific pattern or config cause this problem because with the same action sometime file delete, sometime not. However, after disable AppArmor I don't found this problem anymore.

To disable apparmor run commands below:

service apparmor stop 
update-rc.d -f apparmor remove 
apt-get remove apparmor apparmor-utils
Pattapong J
  • 151
  • 6