Reputation: 1
I use net-sftp gem for uploading file to remote server.
Net::SFTP.start(host, user, port: port, key_data: [decoded_key], keys: [], keys_only: true, logger: logger, verbose: :debug) do |sftp|
sftp.upload!(local_file_path, remote_file_path)
end
Sometimes it works and file remains on the remote sftp server. And sometimes it is downloaded and soon disappears (after one or two seconds). I can see it by using FileZilla in parallel.
Sometimes one file can be uploaded successfully from the first attempt and sometimes from second or third etc. If i use FileZilla manually or sftp from terminal then all works ok. The debug log seems the same for success attempt and for not. No log entries indicate errors.
The gems versions:
net-ssh (5.2.0)
net-sftp (2.1.2)
I will be grateful for any thoughts on this issue.
Upvotes: 0
Views: 1043