Forum: Ruby on Rails Strange problems with net/ftp in Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
65c04c5dc6aa662abdd70275b024dbcc?d=identicon&s=25 Raymond Brigleb (Guest)
on 2006-05-03 22:13
(Received via mailing list)
Lately I've been having a very strange problem with my Rails app
running on TextDrive. Part of its job is to send files to a remote
server, using net/ftp. This has always worked fine, but in the last
week or two, I've had huge problems sending them to servers at A Small
Orange (another hosting company). Not all the time, but some of the
time. Weird.

What happens is that the first file to be transferred just hangs.
Usually, the whole batch goes over, no problem. But lately, some sites
will start the transfer of the first file, and hang. It creates a file
on the destination server, but it's a zero byte file.

I make a connection and login:

@connection = Net::FTP.new @website.site_ftp
@connection.login( @website.username, @website.password )

I then change to the right folder and send the file:

chdir remote_path
@connection.putbinaryfile local, remote_file

And the error is raised on that last line - just a TransferError from
the net/ftp library, and a zero-byte file after hanging for about 30
seconds.

Can anyone offer any suggestion at all? Bear in mind this has worked
fine with a great number of hosts, even this problematic host until
about a week ago. I've contacted the admin of ASO and he suggested
that I might want to try "changing between the PASV and PORT
connection methods" but I'm not sure how to do this with net/ftp, or
if it will break my other sites using this app. What should I try
next?
This topic is locked and can not be replied to.