From: Tim Uckun Date: 2012-06-06T12:54:39+09:00 Subject: Net::SFTP hangs when downloading a file. I have some code which attempts to download some data from an sftp server and it hangs. Once it hangs it seems to lock up the entire process so the timeout is not working either. The code hangs at the session.download! method (debug output below) The same code works for other servers and even other directories on the same server so this is very baffling to me. I am using ruby 1.9.3 but I have also tried it with ruby 1.8.7. The Timeout::timeout wrapper doesn't do anything since the blocking is apparently locking up the entire process. debug output sending open packet (2) queueing packet nr 13 type 94 len 92 sent 116 bytes read 68 bytes received packet nr 15 type 94 len 44 channel_data: 0 17b received sftp packet 102 len 13 sending read packet (3) queueing packet nr 14 type 94 len 44 sent 68 bytes read 1358 bytes read 742 bytes received packet nr 16 type 94 len 2076 channel_data: 0 2048b received sftp packet 103 len 2044 sending read packet (4) queueing packet nr 15 type 94 len 44 sent 68 bytes read 52 bytes received packet nr 17 type 94 len 28 channel_data: 0 2b read 84 bytes received packet nr 18 type 94 len 60 channel_data: 0 32b sending close packet (5) queueing packet nr 16 type 94 len 44 sent 68 bytes read 68 bytes received packet nr 19 type 94 len 44 channel_data: 0 28b