You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FTP upload and download for big files (over 10GB) fails #5328
This happens only for big files (over 10GB): the upload goes to 100% then rclone disconnects, reconnects to check the file on destination but declares that the upload has failed and restarts it! Adding --no-check-dest --low-level-retries 1 does not resolve the issue.
It works when uploading manually with the ftp command! So the issue is NOT with the FTP server!
Typical rclone log/verbose going into a loop:
2021-05-13 18:34:22 DEBUG : big.zip: Need to transfer - File not found at Destination
2021-05-13 18:44:53 DEBUG : ftp://server.com:21/: Connecting to FTP server
2021-05-13 18:44:54 DEBUG : big.zip: Removed after failed upload: read tcp IP1:37706->IP2:21: i/o timeout
2021-05-13 18:44:54 DEBUG : big.zip: Received error: update stor: read tcp IP1:37706->IP2:21: i/o timeout - low level retry 1/10
My suggestions/questions to fix:
a) Why does rclone disconnects + reconnects to check the file instead of using the same FTP session?
b) Can't rclone sleeps for 2-3 seconds before doing the check of the uploaded file?
a) Why does rclone disconnects + reconnects to check the file instead of using the same FTP session?
Good idea...
In the code you linked, rclone could open a new connection and check the size of the file. It if was as expected then it could leave it alone rather than deleting it.
Fancy sending a pull request to fix?
b) Can't rclone sleeps for 2-3 seconds before doing the check of the uploaded file?
I had a second look at this, and I think the bug is somewhere else: rclone is not reading the reply from the FTP server! If you look at the --dump bodies one:
@ivandeex can you re-tag this issue as bug?.. I think it needs to be looked after urgently~ I know that you have raised another issue with that FTP library too ( #5283 ) I wonder why curl isn't used for FTP?... It will be less buggy than this library~
Your connection transferred the data though didn't it?
Both of my servers were on IPv4, I see no reasons why EPSV should be enabled anyway. I think there are and there will be others with the same problem. Thus my advice to disable it by default. The exact rule is: if one of the server is on IPv4 only (client or remote), then EPSV should be disabled.
I'm glad you made it work :-)
We have the disable EPSV option for those that require it, but for the vast majority of users it works fine.
jlaffaye/ftp makes control/data streams from a factory provided by rclone. this factory wraps go tcp streams in the code which cancels streams after timeout but resets timeout timer after each read/write.
a typical ftp upload is: client talks with ftp server on control stream, sets upload parameters, then create one or more data streams and do the upload (this can be long), then return to control stream and ask ftp server about upload results (here be dragons)
while client was busy uploading on data stream, the control stream timeout happened and client's attempt to read status returned I/O timeout
I encountered similar problem and investigated.
I'm now 100% sure we hit rclone bug with ftp timeouts!
Ah ha!
bug description follows:
jlaffaye/ftp makes control/data streams from a factory provided by rclone. this factory wraps go tcp streams in the code which cancels streams after timeout but resets timeout timer after each read/write.
a typical ftp upload is: client talks with ftp server on control stream, sets upload parameters, then create one or more data streams and do the upload (this can be long), then return to control stream and ask ftp server about upload results (here be dragons)
while client was busy uploading on data stream, the control stream timeout happened and client's attempt to read status returned I/O timeout
Activity
ncw commentedon May 14, 2021
Good idea...
In the code you linked, rclone could open a new connection and check the size of the file. It if was as expected then it could leave it alone rather than deleting it.
Fancy sending a pull request to fix?
Why do you think that would help?
jcn50 commentedon May 14, 2021
Sorry this is above my abilities 😞
In the FTP library code referenced in my first post: the author has a sleep time that may be too low/small.
jcn50 commentedon May 15, 2021
I had a second look at this, and I think the bug is somewhere else: rclone is not reading the reply from the FTP server! If you look at the
--dump bodiesone:but it should be like this:
I don't know why rclone is not waiting for that 226 code reply?
jcn50 commentedon May 16, 2021
Guys: there is an issue with the download as well. It's the same as #4622
jcn50 commentedon May 16, 2021
@ivandeex can you re-tag this issue as
bug?.. I think it needs to be looked after urgently~ I know that you have raised another issue with that FTP library too ( #5283 ) I wonder why curl isn't used for FTP?... It will be less buggy than this library~[-]FTP upload for big files (over 10GB) fails[/-][+]FTP upload and download for big files (over 10GB) fails[/+]jcn50 commentedon May 16, 2021
I do not know how to make a pull request, I do not understand.
I think a sleep needs to be added just before the Update() function is called:
17 remaining items
ncw commentedon May 18, 2021
Your connection transferred the data though didn't it?
I'm glad you made it work :-)
We have the disable EPSV option for those that require it, but for the vast majority of users it works fine.
jcn50 commentedon May 18, 2021
Yes~
OK np
ncw commentedon May 18, 2021
OK, I'm going to close this now as I think we've arrived at a solution and the issue will be searchable for anyone having the same problem.
Thanks
ivandeex commentedon Jul 28, 2021
I encountered similar problem and investigated.
I'm now 100% sure we hit rclone bug with ftp timeouts!
@ncw
bug description follows:
@ncw
preliminary fix for:
@jcn50
Do you want to try experimental fix? It's here:
https://github.com/ivandeex/rclone/releases/tag/v1.56.0-ftp08
ncw commentedon Jul 28, 2021
@ivandeex wrote:
Ah ha!
OK that makes sense.
The deadline will be reset if we get data on the stream. I guess that is your intention.
LGTM :-)