{"action":"created","issue":{"url":"https://api.github.com/repos/paramiko/paramiko/issues/151","labels_url":"https://api.github.com/repos/paramiko/paramiko/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/paramiko/paramiko/issues/151/comments","events_url":"https://api.github.com/repos/paramiko/paramiko/issues/151/events","html_url":"https://github.com/paramiko/paramiko/issues/151","id":12332594,"number":151,"title":"EOFError when getting a big file (900MB) via SFTP.","user":{"login":"etienned","id":251190,"avatar_url":"https://avatars.githubusercontent.com/u/251190?v=3","gravatar_id":"","url":"https://api.github.com/users/etienned","html_url":"https://github.com/etienned","followers_url":"https://api.github.com/users/etienned/followers","following_url":"https://api.github.com/users/etienned/following{/other_user}","gists_url":"https://api.github.com/users/etienned/gists{/gist_id}","starred_url":"https://api.github.com/users/etienned/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etienned/subscriptions","organizations_url":"https://api.github.com/users/etienned/orgs","repos_url":"https://api.github.com/users/etienned/repos","events_url":"https://api.github.com/users/etienned/events{/privacy}","received_events_url":"https://api.github.com/users/etienned/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paramiko/paramiko/labels/Bug","name":"Bug","color":"a04040"},{"url":"https://api.github.com/repos/paramiko/paramiko/labels/Needs%20investigation","name":"Needs investigation","color":"fad8c7"},{"url":"https://api.github.com/repos/paramiko/paramiko/labels/Needs%20patch","name":"Needs patch","color":"fad8c7"},{"url":"https://api.github.com/repos/paramiko/paramiko/labels/Nonstandard%20platforms","name":"Nonstandard platforms","color":"d4c5f9"},{"url":"https://api.github.com/repos/paramiko/paramiko/labels/SFTP","name":"SFTP","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2013-03-22T18:52:15Z","updated_at":"2015-04-29T16:16:31Z","closed_at":null,"body":"I'm trying to use duplicity to backup my server to a CrushFTP server (windows) in SFTP, but it always drop connection when getting some big files.\r\n\r\nSo I tried to get a problematic file with paramiko directly and got the same error `Server connection dropped` meaning an `EOFError` was raise (bytes received == 0). I put a print statement in `_read_all` method to show how many bytes were received. On one thread it's getting rapidly to 32777 then stay there. Another thread goes up to 7049 then back to 0 and then never more then 200. After a long long time (many minutes) I receive the `EOFError`.\r\n\r\nIf I try to get the same file with `lftp` it works without any problems.\r\n\r\nUsing paramiko 1.10.0, python 2.6.5 on Ubuntu Server LTS 10.0.4 amd64."},"comment":{"url":"https://api.github.com/repos/paramiko/paramiko/issues/comments/97485255","html_url":"https://github.com/paramiko/paramiko/issues/151#issuecomment-97485255","issue_url":"https://api.github.com/repos/paramiko/paramiko/issues/151","id":97485255,"user":{"login":"joostdevries","id":3824616,"avatar_url":"https://avatars.githubusercontent.com/u/3824616?v=3","gravatar_id":"","url":"https://api.github.com/users/joostdevries","html_url":"https://github.com/joostdevries","followers_url":"https://api.github.com/users/joostdevries/followers","following_url":"https://api.github.com/users/joostdevries/following{/other_user}","gists_url":"https://api.github.com/users/joostdevries/gists{/gist_id}","starred_url":"https://api.github.com/users/joostdevries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joostdevries/subscriptions","organizations_url":"https://api.github.com/users/joostdevries/orgs","repos_url":"https://api.github.com/users/joostdevries/repos","events_url":"https://api.github.com/users/joostdevries/events{/privacy}","received_events_url":"https://api.github.com/users/joostdevries/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T16:16:31Z","updated_at":"2015-04-29T16:16:31Z","body":"Running into this issue with a significantly smaller file too. I've tracked it down to the fact that the max. packet_size/window_size are very small after connecting (4096 and 32759).. If I manually override these values to I can get to 2.1 MB before the upload stalls..\r\n\r\nThe only way of overriding that worked so far was:\r\n\r\n```\r\n        sftp_connection.get_channel().in_window_size = 2097152\r\n        sftp_connection.get_channel().out_window_size = 2097152\r\n        sftp_connection.get_channel().in_max_packet_size = 2097152\r\n        sftp_connection.get_channel().out_max_packet_size = 2097152\r\n```\r\n\r\n\r\n@bitprophet would love to work with you on debugging this. "}}