Lohith MV
Lohith MV

Reputation: 3908

Why do I get a sftp time out error?

I am using the net-sftp gem to access a file in an sftp account. I am doing some bulk operations like copying more then 100 files from one sftp account to other but I am getting an error:

Net::SFTP::StatusException (4, "failure")

I think this is happening because of a session time out or buffer size limit? If that is the case, how do I increase the limit so that I can perform bulk operations for more than 100 files.

Here is the stack trace:

    Net::SFTP::StatusException (4, "failure")
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:845:in `wait_for'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net  /sftp/session.rb:589:in `rename!'",
"/home/xxxxx_user/prod/lib/tasks  /xxxxx_rfa_intake.rake:72:in `move'",
"/home/xxxxx_user/prod/lib/tasks  /xxxxx_rfa_intake.rake:61:in `process'",
"/home/xxxxx_user/prod/lib/tasks  /xxxxx_rfa_intake.rake:26",
"/home/xxxxx_user/prod/lib/tasks  /xxxxx_rfa_intake.rake:20:in `each'",
"/home/xxxxx_user/prod/lib/tasks/xxxxx_rfa_intake.rake:20",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:938:in `call'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:938:in `do_version'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:938:in `each'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:938:in `do_version'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:908:in `when_channel_polled'",
"/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `to_proc'",
"/usr/local/lib/ruby/gems/1.8/gems/net-ssh-2.0.21/lib/net/ssh/connection/channel.rb:311:in `call'",

Upvotes: 0

Views: 1974

Answers (1)

the Tin Man
the Tin Man

Reputation: 160551

These two lines say the code is timing out waiting for a rename:

"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:845:in `wait_for'", 
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:589:in `rename!'", 

which is occurring in your code:

"/home/xxxxx_user/prod/lib/tasks/xxxxx_rfa_intake.rake:72:in `move'", 

For some reason the move is failing. In my experience that is either because the permissions are not right, or a drive is full, but there could be many other reasons too.

Because you didn't supply any source code that is as much help as I can give.

Upvotes: 2

Related Questions