Author Topic: sftp connection errors  (Read 4029 times)

Offline rmceoin

  • Newcomer
  • *
  • Posts: 4
    • View Profile
sftp connection errors
« on: February 04, 2019, 10:09:09 AM »
Hello, we are in the process of switching from an FTP server to a new SFTP server.  Several of our users are running into occasional errors in uploading.  If they try again, it works.   In working with one specific user, you can see in their logs that it consistently errors out on the first two files, then one minute later it successfully uploads all of the remaining photos.  The user is able to immediately invoke another upload in order to get the first two files to send.  I've confirmed that this user is on the latest build 19728.

Here is the error they're getting.

SFTP    ./ruby/lib/ruby/1.8/net/ssh/ruby_compat.rb:33:in `select': closed stream

FYI, the server they're connecting to is a GCP hosted CentOS 7.6 with openssh-7.4p1-16.el7.x86_64.

Any suggestions on how to troubleshoot this?

Thank you!
Randy

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24965
    • View Profile
    • Camera Bits, Inc.
Re: sftp connection errors
« Reply #1 on: February 04, 2019, 10:25:21 AM »
For a problem like this, I suggest contacting our support folks at:

By email: support@camerabits.com

By phone: +1 503.547.2800 option 2

Hours: Mon-Fri, 9:00am-5:00pm [PST/PDT]

Offline rmceoin

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Re: sftp connection errors
« Reply #2 on: February 04, 2019, 10:26:59 AM »
Sounds good, thank you.

Offline rmceoin

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Re: sftp connection errors
« Reply #3 on: February 05, 2019, 09:07:19 AM »
I managed to get a packet capture when the error happened and have figured out what the issue is.

The issue appears to be that PM opens an SFTP session to the server and does not close the session.  Presumably it keeps it open under the premise that if you were to upload additional images it would be quicker.   However, what I saw was that the end user did an upload at the 11am hour.   I saw in the server logs that the session was closed by the server later in that hour.   Then at the 3pm hour the user attempted to upload an additional image.  At that point I saw PM attempt to use what it thought was an existing SFTP session.   Since the server had long since closed the session it naturally errored out and unfortunately PM seems to not attempt to reconnect for that specific image upload.

Other than coaching the user to close the upload task, is there a setting in PM to have it immediately close or auto-close an idle session?   As it stands the end user has the impression that the server errored, when in fact PM was trying to use a long since closed session.

If you'd like to replicate the issue, then follow these steps:

1. In PM, upload an image and do not close the task.
2. On the SFTP server, kill the ssh process.   Either that or wait for the server to timeout.  In the case of a default openssh on CentOS, it appears to be 30 minutes.
3. On PM, attempt to upload an image.   It should error out.

Thanks!

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24965
    • View Profile
    • Camera Bits, Inc.
Re: sftp connection errors
« Reply #4 on: February 05, 2019, 09:26:46 AM »
I managed to get a packet capture when the error happened and have figured out what the issue is.

The issue appears to be that PM opens an SFTP session to the server and does not close the session.  Presumably it keeps it open under the premise that if you were to upload additional images it would be quicker.   However, what I saw was that the end user did an upload at the 11am hour.   I saw in the server logs that the session was closed by the server later in that hour.   Then at the 3pm hour the user attempted to upload an additional image.  At that point I saw PM attempt to use what it thought was an existing SFTP session.   Since the server had long since closed the session it naturally errored out and unfortunately PM seems to not attempt to reconnect for that specific image upload.

Other than coaching the user to close the upload task, is there a setting in PM to have it immediately close or auto-close an idle session?

No.  I consider this a bug.  I will file it in our bug tracking system.

Thanks for the follow up.

-Kirk

Offline rmceoin

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Re: sftp connection errors
« Reply #5 on: February 05, 2019, 09:28:35 AM »
Excellent.

By chance is the bug tracking public facing?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24965
    • View Profile
    • Camera Bits, Inc.
Re: sftp connection errors
« Reply #6 on: February 05, 2019, 09:29:43 AM »
Excellent.

By chance is the bug tracking public facing?

No.

Offline mcardon

  • Newcomer
  • *
  • Posts: 10
    • View Profile
Re: sftp connection errors
« Reply #7 on: February 28, 2019, 10:32:42 AM »
Will this bug be fixed in the March release?