[Bug]: FileZilla retries FTP uploads indefinitely when a file exceeds the user disk quota
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration issue.
- This issue is not already reported on Github (I've searched it).
Bug description
When a file larger than the user's disk quota is uploaded through FTP using FileZilla Client, SFTPGo stops the transfer after the quota is exceeded.
However, FileZilla immediately starts uploading the same file again. The same upload repeats indefinitely.
SFTPGo 2.5.6 correctly returns:
552 Issue during transfer: storage limit exceeded
Nevertheless, FileZilla sends another PASV, MLSD, PASV, and STOR sequence and starts uploading the same file again.
Each attempt receives approximately 10 MB before failing. SFTPGo then deletes the temporary file, so the user's disk usage returns to its previous value. The next STOR request is therefore accepted, and the cycle repeats indefinitely.
The SFTPGo server log repeatedly shows:
Unexpected error for transfer error: "storage limit exceeded" bytes received: approximately 10027008
upload denied due to space limit delete temporary file
transfer error: storage limit exceeded
transfer added
I also reproduced the same endless retry behavior using a recent SFTPGo 2.7.x version. That version returned a 550 network error instead of 552, but changing the response to 552 in version 2.5.6 did not stop the repeated upload.
A Wireshark capture showed no packet loss or TCP retransmissions. SFTPGo stops the data connection when the quota is exceeded, sends the FTP error over the control connection, and FileZilla then starts a new upload.
Steps to reproduce
- Install SFTPGo Community on Windows Server using the Windows x86_64 .exe installer.
- Enable the FTP service using port 21 and configure a passive port range.
- Create an SFTPGo user with a local filesystem home directory.
- Set the user's disk quota to 10 MB.
- Connect to SFTPGo using FileZilla Client in FTP passive mode.
- Upload a file larger than the configured 10 MB disk quota.
- Wait until SFTPGo stops the upload and returns:
- 552 Issue during transfer: storage limit exceeded
- Observe that FileZilla immediately sends another sequence similar to:
- PASV
- MLSD
- PASV
- STOR test-audio.wav
- Observe that SFTPGo accepts the new STOR request, receives approximately 10 MB again, detects the quota limit, deletes the temporary file, and returns another 552 response.
- The same upload starts again and the process repeats indefinitely until the transfer is manually stopped.
Expected behavior
An oversized file should not be uploaded repeatedly without limit after the user's disk quota has already been exceeded.
After the first quota-exceeded failure, SFTPGo should ideally do one of the following:
- Reject the subsequent STOR request before receiving additional file data.
- Preserve sufficient quota or failed-transfer state to prevent the same oversized upload from immediately starting again.
- Provide a server-side option that prevents repeated FTP uploads after a disk-quota failure.
- Return or close the transfer in a way that FTP clients treat as a non-retryable quota error.
If this behavior must be handled entirely by the FTP client, please confirm whether there is any recommended SFTPGo server-side workaround that still uses disk quota rather than cumulative upload-transfer quota.
SFTPGo version
SFTPGo 2.5.6 Build: a6a92f0d Build date: 2023-12-18T17:47:30Z | The same repeated-upload behavior was also observed with a recent SFTPGo 2.7.x release.
Data provider
SQLite Track quota: 2 Delayed quota update: 0 | The uploaded files are stored on the local Windows filesystem.
Installation method
Other
Configuration
Operating system: Windows Server Storage provider: Local filesystem Protocol: Plain FTP FTP control port: 21 FTP mode: Passive Passive port range: 50000–51999 Upload mode: 0 Data provider: SQLite Track quota: 2 User disk quota: 10 MB Max upload file size: 0 FTP client: FileZilla Client Test file: Larger than the configured 10 MB disk quota
Relevant configuration:
{ "common": { "upload_mode": 0 }, "ftpd": { "bindings": [ { "port": 21, "tls_mode": 0, "force_passive_ip": "[SERVER_IP]" } ], "passive_port_range": { "start": 50000, "end": 51999 } }, "data_provider": { "driver": "sqlite", "track_quota": 2, "delayed_quota_update": 0 } }
The following evidence is available:
FileZilla screenshot showing the same upload repeating indefinitely Redacted SFTPGo debug log Wireshark packet capture
Relevant log output
What are you using SFTPGo for?
Medium business
Additional info
No response
Source: drakkan/sftpgo