Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Connection reset by peer - recvfrom(2) #67

Open
dakingdom opened this issue Sep 1, 2017 · 4 comments
Open

Error: Connection reset by peer - recvfrom(2) #67

dakingdom opened this issue Sep 1, 2017 · 4 comments

Comments

@dakingdom
Copy link

Push of files to a remote via ruby net-SFTP causes "Connection reset by peer - recvfrom(2)" error . Pulling of remote of files is fine.

Found out our routers intrusion detection and prevention was causing this error trying to stop this type of venerability: SSH_EVENT_RESPOVERFLOW.

This does effect Linux command line scp pushes too. scp pulls are also fine.

It seems to occur on larger file sizes.

I thought I would report this as an issue to help others debug "Connection reset by peer - recvfrom(2)".

@wakproductions
Copy link

I'm getting the same error message, but uploading via FileZilla SFTP client works just fine. @dakingdom was the intrusion detection problem on the FTP server side or the local network you were uploading from?

@dakingdom
Copy link
Author

The dropping of the transfer was either coming into our local network or within our local network. Always in the uploading direction. I tested it with scp and a large file. In this case a large file would be in the 200MB or larger range. Smaller files than that was not a problem. Sorry I guess, my reference frame for large file should have been clearer.

@wakproductions
Copy link

wakproductions commented Aug 1, 2018

I think I resolved the issue. Previously I was using code similar to this to perform the upload:

Net::SFTP.start(...) do |sftp|
sftp.file.open(destination, 'w') do |handle|
  handle.puts builder.to_xml
end

Seems to be working when I do it this way:

Net::SFTP.start(...) do |ftp|
   ftp.upload(StringIO.new(generated_file.attachment.download), destination)
end

@SpringsTea
Copy link
Contributor

I am having this issue as well, but it's very sporadic. I have a bare basic implementation.

@con = Net::SFTP.start(@@host, @@username, :password => @@password)
@con.upload!(filepath, destination)

I had this running like this for several years when suddenly this year it started throwing this error. But not all the time, only sometimes. Sometimes it works with no issue. I've talked to my sftp host and they tell me there is no problem on their end. I'm transferring xml files and images in the < 5MB range. Any troubleshooting advice is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants