Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

MAtEM

Hi Martin,

Thank you for the response. I can't explain why, but the scripts are working without any issues now. What's weird is that if I was using a .txt file on the same shared folder as the photos, the .txt file would get transfer without any issues, but the images wouldn't. The images weren't that large.

Thank you
martin

Re: PutFiles() Session timeout error

It seems that WinSCP hangs when trying to access the shared folder. I haven't seen this before. Does the script work, when you execute it manually? (I see that you use some automation tool to run it now)
MAtEM

PutFiles() Session timeout error

Hello,

Since at the end of last week, multiple PowerShell scripts that are used to transfer .jpg files from a shared folder on a Windows server to a set of SFTP Unix based servers have stopped working throwing the following error:
Error occurred with the script. Error: Exception calling "PutFiles" with "4" argument(s): "Timeout waiting for WinSCP to

 respond"
At E:\PhotoSFTP.ps1:127 char:17
+ ...             $transferResult = $session.PutFiles($source_location, $de ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : TimeoutException

I have tried increase the timeout from 60 seconds, to 120 seconds, to 200 seconds. I have re-installed WinSCP, rebooted the server, but nothing. I also installed WinSCP 5.21.2. Originally I was on the latest version of WinSCP, but I reverted back to an older version in case it was something with the latest version. I can confirm that the account the script is running under has access to the shared folder where the images are located. I can also confirm that it is not an issue with the destination server, since I can manually connect to it via the GUI, and upload images without any issues. For some reason, the timeout seems to be happening only with .jpeg images. If I change the script to upload for example .txt files, it works without any issues.

Anyone that might be able to point me to the right direction? I am completely stuck and not entirely sure what else I can try next. Attached are some session/debug logs.

Thank you