I am having a problem with Net::SFTP, maybe you experienced it too and
I don't know what to do about it.
While executing the following instructin:
sftp.get_file(filePath, localFilePath)
Depending on the file downloaded (maybe on size ?), I get the following
exception:
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/packet-stream.rb:203:in
`sysread': bignum too big to convert into `long' (RangeError)
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/packet-stream.rb:203:in
`read'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/packet-stream.rb:167:in
`get'
from /usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/packet-stream.rb:147:in
`get'
from
/usr/lib/ruby/gems/1.8/gems/needle-1.2.1/lib/needle/lifecycle/proxy.rb:60:in
`method_missing'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/session.rb:245:in
`wait_for_message'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/session.rb:240:in
`wait_for_message'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/connection/driver.rb:148:in
`process'
Please, please help me, because I have a deadline and I don't know what
to do.
I am having a problem with Net::SFTP, maybe you experienced it too and
I don't know what to do about it.
While executing the following instructin:
sftp.get_file(filePath, localFilePath)
Depending on the file downloaded (maybe on size ?), I get the following
exception:
A few questions:
1. Does it happen every time?
2. Is this the complete backtrace (I'm not seeing an Net::SFTP code there...)
3. How big is the file in question?
4. If it works with some files, how big are the files that work?
5. What OS is the server you are connecting to?
6. What SSH vendor and version is the server running?
7. Does the operation succeed if you send to a different server?
8. What is your local OS and Ruby version?
- Jamis
···
On Oct 23, 2005, at 6:12 PM, bonefry wrote:
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/packet-stream.rb:203:in
`sysread': bignum too big to convert into `long' (RangeError)
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/packet-stream.rb:203:in
`read'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/packet-stream.rb:167:in
`get'
from /usr/lib/ruby/1.8/thread.rb:135:in `synchronize'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/packet-stream.rb:147:in
`get'
from
/usr/lib/ruby/gems/1.8/gems/needle-1.2.1/lib/needle/lifecycle/proxy.rb:60:in
`method_missing'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/session.rb:245:in
`wait_for_message'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/transport/session.rb:240:in
`wait_for_message'
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.2/lib/net/ssh/connection/driver.rb:148:in
`process'
Please, please help me, because I have a deadline and I don't know what
to do.
1. Yes, it happens every time
2. No, it's only the first 7 items in the backtrace
3. 17 K
4. it works with a 13 K file
5. Red Hat Enterprise Linux 3
6. OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
7. I haven't had time to test
8. Fedora Core 4, Ruby 1.8.3
I think it uses only a chunk of data when getting the file with
get_file
I tried fetching smaller chunks and it works:
sftp.open_handle(remoteFilePath) do |handle|
data = sftp.read(handle, :chunk_size => 4096)
end