-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
Inconsistent file writing #155
Comments
Also happens on |
Hi, can you please enable verbose logging and post the logs after you reproduce the issue? The logs could help me to understand what happen. This issue could be related to pkg/sftp#295. I'll try to reproduce myself in the next days |
Easy reproduction steps (figured out now):
|
Hi, I did some tests myself and I was able to reproduce the issue. This workaround fix the problem for me:
On my system I have these logs for OpenSSH:
SFTPGo does not receive this command:
I'll try to fix the root issue, in the meantime please use the above workaround, thank you |
Thank you, that does the trick for sshfs on Linux 😄 On Windows however (sshfs-win), I discovered more bizarre behaviour (sorry for droll examples): While on On Windows, tried both combinations of latest pre-releases and releases of sshfs-win and winfsp: |
Hi, the truncate bug should be fixed in this commit, so the option If you don't want to build yourself the latest version you can download pre-built binaries from here. Can you please confirm that sshfs on Linux now works as expected for you too? Thank you |
Hi, regarding your second issue I think
Hi, I replicated the issue using sshfs-win, I think it happens because the same file is opened for both reading and writing and this mode is not currently supported in pkg/sftp. This is a big change in pkg/sftp so I have to agree with their maintainers what is the best way to support this feature. So the fix could require some time, sorry. I'll ask you to try a preliminary patch, when it will be ready, if you want, thank you. |
Confirmed with Linux sshfs that 7381a86 fixes truncation issue. With Windows version, at least with VSCode (I think it opens file differently) this issue is gone as well.
Definitely! 😄 |
Hi again, can you please confirm that my proof of concept patch works for your use case? Thank you |
Great! Thanks for confirming, please let me know if you have other issues. |
Hi, I updated the pkg/sftp patch and rebased the sftpgo patch on current master. I think I will merge the updated patch the next week, please let me know if you have any issue. I think it should work also if you run sftpgo on Windows but I haven't yet tested this. Thank you. |
Will let you know later today (20:00, Europe/Tallinn timezone). Getting connectivity issues to gopkg.in and other repositories where Go modules are being downloaded right now. |
Thank you! You can also download a pre-built binary from here |
Everything seems to work fine right now, I didn't encounter any issues. Forgot about testing at promised time, sorry. |
thanks for confirming |
I've observed this very odd issue where my team member manages to write file over partially, previous file content's end remains after uploading (seems to happen when new content is smaller than old content, sounds like file is not getting truncated properly).
Team member uses sshfs-win to manage files. This issue seems to happen more often using this client, but can be seen every once in a while using vanilla sshfs as well. This issue seems to be quite hard to be reproducible consistently.
More interesting fact is that sshfs reports correct file contents, while remote server has previously described corrupted contents (which is probably because of sshfs-level caching I think? Not sure but worth mentioning).
Does not happen with OpenSSH, so probably not an issue with sshfs.
I'm not sure whose fault this is right now - is it because of SFTPGo? Or is it because of (kind of unlikely) ZFS oddities? I'm lost.
Any ideas where to start looking?
SFTPGo version info
SFTPGo version:
Go version:
Build commands:
The text was updated successfully, but these errors were encountered: