-
Notifications
You must be signed in to change notification settings - Fork 91
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
SCP freezes wthen downloading large files: #486
Comments
same issue |
@tgeek77 mb already solve? |
No, it's still happening on my system. |
idk, it looks like huge bug and no activity here, sad... |
Hello, I had some trouble reproducing it, but indeed it seems that on large files, it stalls at the end of the file regardless of its size, as long as it's big enough. Seems like some kind of race condition, I'll dig into it. |
OK, it can actually happen with files as small as 50 MiB, but the bigger the file, the most likely it'll happen. This seems to happen mostly on downloads, not so much on uploads. After some stracing, it appears that once the file has been read on the sending side, the scp server closes its file descriptor and sends an EOF as it should, but then waits for confirmation that the file has indeed been transferred forever: this is where sometimes, the deadlock happens. When it does, you'll be missing 64 KiB (the size of the read buffer) of the file on the receiving side, no matter what. I've changed the exec mode of the scp plugin to remove some buffering that happens on the bastion itself, as I guessed this would be where the race condition could happen. With this change, I can no longer reproduce the issue. The only noticeable drawback is that the bastion can no longer report how many bytes have flowed through scp. The line:
will be replaced by:
which seems a negligible compromise to make. |
That sounds like an acceptable compromise to me. My team is using The Bastion in a our production environment and we have people asking to add their own SSH keys to the server as a workaround when manually gathering logs. It would be good to see this fix. |
fixed in |
I have scheduled a change window for 1hr 15m from now. I will update with my test results. |
Works for me! Test file was > 100MB
|
Good, internally some people had the issue and they confirm that the issue disappeared too. Closing as resolved then! |
Just confirming this scp fix works for scp download of files up to 5GB so far for us, so thank you for fixing. I notice rsync pull (and only rsync pull) seems to have a similar pattern of behaviour in that I can push large files via rsync fine from system A to system B via bastion, but when I test rsync pull via bastion, it seems to be ok up to about 100mb max and then it won't let me pull down larger files. Even below 100mb, it sometimes gives errors when it is over 45-50mb for the rsync pull and I had similar test case results with scp download until this fix and that issue is resolved. Let me know if you prefer I open a separate issue for tracking for rsync pull test, if you can recreate. Testing (for scp download) and rsync pull done against bastion version v3.18.00. Error Result
|
@niallguerin I think it would be a good idea to also give an example of the command that you are using. You can obfuscate real hostnames with example.com or use x.x.x.x for IP addresses. |
@niallguerin could you open a new issue indeed? I'll see if I can reproduce. When this happens, does rsync appear to just be stuck, so you CTRL+C it and then it shows the error lines you've pasted, or does this give out an error directly, instead of getting stuck? If it's stuck, it's probably a similar issue and the fix might be the same, otherwise, it can be a different issue. You might want to include the whole command you've typed and the whole output, removing any sensitive information as @tgeek77 suggested. Thanks! |
Sorry for delay in responding. I'll open a separate issue as requested. I just want to set up some stuff to reproduce on another server at home as well as work. To answer your last reply, unlike the old scp behaviour (that was fixed), the rsync fails immediately without input from me (i.e. I do not hit CTRL+C in terminal) and the rsync pull fail case only occurs when the file is large whereas in the old scp large file download issue it did just become "stuck", rsync large file errors out immediately for me. Smaller files are fine though for rsync pull. I'll send full command and log output with hosts obfuscated as requested and I will log it as separate issue as scp issue is fixed for large files. Thank you. |
This is the command that I am using at the output:
As you can see, the file is over 2GB. If I try this with a small file, it works. If I try it with directly scp (not using the bastion), it also works. This seems to be a hard limit to upload/download sizes that is not documented. I checked here and here.
The text was updated successfully, but these errors were encountered: