我正在使用 net-sftp gem 来访问 sftp 帐户中的文件。我正在执行一些批量操作,例如将 100 多个文件从一个 sftp 帐户复制到另一个帐户,但出现错误:
Net::SFTP::StatusException (4, "failure")
我认为这是因为会话超时或缓冲区大小限制而发生的?如果是这种情况,我该如何增加限制,以便我可以对 100 多个文件执行批量操作。
这是堆栈跟踪:
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'",