Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP AFTP backend data upload corruption fix #3866

Merged
merged 1 commit into from Aug 22, 2019

Conversation

BlueBlock
Copy link
Contributor

@BlueBlock BlueBlock commented Aug 20, 2019

This is a proof of concept fix since there will likely be a more elegant solution. But this is a working fix and possibly similar is needed for the ftp backend.

Currently AFTP will seemingly transfer a file via async ftp and return 'success' even though it seems the transfer is still proceeding. The symptom looks to be an error stating the hashes do not match.

I am able to reproduce every time when not in debug mode. Debug mode seems to introduce enough delay that the error never occurs, at least not for me.

There might be another issue going on with timing between processes; I'm not sure. The simplistic solution is to loop the check for the file size and only proceed when the file size is correct or our set time for checking has expired.

  • Can this solution be a stop-gap fix even in the event there is a more involved issue deeper in Duplicati?

  • As a WIP and discussion on this fix, what modifications to the check might others suggest? A better way than sleep()?

Real data is shown below to show how after the async upload the remote file size is smaller and continues to grow until it is the correct size. This is using a FileZilla Server installed on the same machine. The data is sorted by the filename. At 250 ms you'll see that for the blocks there is generally a number of rechecks that occur.

aftp-fix-test.csv.txt

proof of concept fix
@duplicatibot
Copy link

This pull request has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/alternative-ftp-failure/7822/7

Copy link
Member

@Pectojin Pectojin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a fair compromise to the issue.

Only downside to the issue being that it's hard-coded to not exceed 5 seconds. I imagine that could be an issue on slow connections or with large files.

@Pectojin Pectojin merged commit 240ea22 into duplicati:master Aug 22, 2019
@BlueBlock BlueBlock deleted the fix-aftp-backend branch August 23, 2019 03:24
@BlueBlock
Copy link
Contributor Author

We can revisit if the 5 seconds is an issue. Ideally I'd like to Polly and have a smarter retry. But at least this fixes the most immediate problem.

@duplicatibot
Copy link

This pull request has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/issues-to-address-to-get-out-of-beta/7871/42

@duplicatibot
Copy link

This pull request has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/alternative-ftp-failure/7822/11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants