# Lost response while transfering large file to FTP server

**URL:** <https://www.ruby-forum.com/t/lost-response-while-transfering-large-file-to-ftp-server/156855>\
**Category:** Ruby\
**Created:** [January 4, 2009, 9:48am UTC](https://www.ruby-forum.com/t/lost-response-while-transfering-large-file-to-ftp-server/156855 "2009-01-04T09:48:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![clive](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f08c70/32.png) [@clive](https://www.ruby-forum.com/u/clive)\
**Post date:** [January 4, 2009, 9:48am UTC](https://www.ruby-forum.com/t/lost-response-while-transfering-large-file-to-ftp-server/156855/1 "2009-01-04T09:48:51Z")

</div>

When I used Net::FTP to put large files(about 200MB) to FTP server, the  
program always lost response. The file was actually transferred  
correctly later on, but the ftp.put method failed to return, preventing  
the code after that method from executing. And the ruby process was not  
terminated.

The ruby version is 1.8.6 on Ubuntu 8.10 64 bit server

Anyone know the problem?

---

<div class="post-metadata">

**Author:** ![clive](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f08c70/32.png) [@clive](https://www.ruby-forum.com/u/clive)\
**Post date:** [January 4, 2009, 3:35pm UTC](https://www.ruby-forum.com/t/lost-response-while-transfering-large-file-to-ftp-server/156855/2 "2009-01-04T15:35:51Z")

</div>

On 04.01.2009 09:47, Clive Lin wrote:

> When I used Net::FTP to put large files(about 200MB) to FTP server, the  
> program always lost response. The file was actually transferred  
> correctly later on, but the ftp.put method failed to return, preventing  
> the code after that method from executing. And the ruby process was not  
> terminated.
> 
> The ruby version is 1.8.6 on Ubuntu 8.10 64 bit server
> 
> Anyone know the problem?

Maybe you executed it in a thread and that died silently. You can make  
the error explicit if you like:

Robert@babelfish2 ~  
$ irb  
irb(main):001:0\> t = Thread.new { raise “silent death” }  
=\> #\<Thread:0x100106d4 dead\>  
irb(main):002:0\> t.join  
RuntimeError: silent death  
from (irb):1  
from (irb):2:in `join' from (irb):2 from :0 irb(main):003:0> Thread.abort_on_exception = true => true irb(main):004:0> t = Thread.new { raise "interpreter kill" } (irb):4:in`irb\_binding’: interpreter kill (RuntimeError)  
from (irb):4:in `initialize' from (irb):4:in`new’  
from (irb):4:in `irb_binding' from /usr/lib/ruby/1.8/irb/workspace.rb:52:in`irb\_binding’  
from :0

Robert@babelfish2 ~  
$ echo $?  
1

Robert@babelfish2 ~  
$

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![clive](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f08c70/32.png) [@clive](https://www.ruby-forum.com/u/clive)\
**Post date:** [January 4, 2009, 4:14pm UTC](https://www.ruby-forum.com/t/lost-response-while-transfering-large-file-to-ftp-server/156855/3 "2009-01-04T16:14:20Z")

</div>

Thanks for reply.  
I didn’t create a new thread to do the ftp job; it’s in main thread. I  
think any exception will be throw to the console, but nothing happened.  
And the file was actually transferred without any error I am aware of.  
ftp.put just couldn’t return.

I attach the source file.

Robert K. wrote:

> On 04.01.2009 09:47, Clive Lin wrote:
> 
> > When I used Net::FTP to put large files(about 200MB) to FTP server, the  
> > program always lost response. The file was actually transferred  
> > correctly later on, but the ftp.put method failed to return, preventing  
> > the code after that method from executing. And the ruby process was not  
> > terminated.
> > 
> > The ruby version is 1.8.6 on Ubuntu 8.10 64 bit server
> > 
> > Anyone know the problem?
> 
> Maybe you executed it in a thread and that died silently. You can make  
> the error explicit if you like:
> 
> Robert@babelfish2 ~  
> $ irb  
> irb(main):001:0\> t = Thread.new { raise “silent death” }  
> =\> #\<Thread:0x100106d4 dead\>  
> irb(main):002:0\> t.join  
> RuntimeError: silent death  
> from (irb):1  
> from (irb):2:in `join' from (irb):2 from :0 irb(main):003:0> Thread.abort_on_exception = true => true irb(main):004:0> t = Thread.new { raise "interpreter kill" } (irb):4:in`irb\_binding’: interpreter kill (RuntimeError)  
> from (irb):4:in `initialize' from (irb):4:in`new’  
> from (irb):4:in `irb_binding' from /usr/lib/ruby/1.8/irb/workspace.rb:52:in`irb\_binding’  
> from :0
> 
> Robert@babelfish2 ~  
> $ echo $?  
> 1
> 
> Robert@babelfish2 ~  
> $
> 
> Kind regards
> 
> robert

---

<div class="post-metadata">

**Author:** ![clive](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f08c70/32.png) [@clive](https://www.ruby-forum.com/u/clive)\
**Post date:** [January 5, 2009, 2:41am UTC](https://www.ruby-forum.com/t/lost-response-while-transfering-large-file-to-ftp-server/156855/4 "2009-01-05T02:41:55Z")

</div>

Clive Lin wrote:

> When I used Net::FTP to put large files(about 200MB) to FTP server, the  
> program always lost response. The file was actually transferred  
> correctly later on, but the ftp.put method failed to return, preventing  
> the code after that method from executing. And the ruby process was not  
> terminated.
> 
> The ruby version is 1.8.6 on Ubuntu 8.10 64 bit server
> 
> Anyone know the problem?

I replaced the ftp.put with the following code:  
ftp\_info=%x{  
pftp -n #{FTP\_HOST} \<\<SCRIPT  
user #{FTP\_USER} #{FTP\_PWD}  
put #{BACKUP\_FILE}  
quit  
SCRIPT  
}  
$logger.info(ftp\_info)  
It still failed to return, without any logger information.

---

<div class="post-metadata">

**Author:** ![clive](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f08c70/32.png) [@clive](https://www.ruby-forum.com/u/clive)\
**Post date:** [January 5, 2009, 2:43am UTC](https://www.ruby-forum.com/t/lost-response-while-transfering-large-file-to-ftp-server/156855/5 "2009-01-05T02:43:56Z")

</div>

Clive Lin wrote:

> I replaced the ftp.put with the following code:  
> ftp\_info=%x{  
> pftp -n #{FTP\_HOST} \<\<SCRIPT  
> user #{FTP\_USER} #{FTP\_PWD}  
> put #{BACKUP\_FILE}  
> quit  
> SCRIPT  
> }  
> $logger.info(ftp\_info)  
> It still failed to return, without any logger information.

And at this time, the backup file still got transferred successfully
