Alexandr Kovalenko
Alexandr Kovalenko

Reputation: 1

After uploading a file using Net::Sftp, the file disappears sometimes

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:

I will be grateful for any thoughts on this issue.

Upvotes: 0

Views: 1043

Answers (1)

Alexandr Kovalenko
Alexandr Kovalenko

Reputation: 1

The problem was on the server side. Thank you all.

Upvotes: 0

Related Questions