PutFiles() Session timeout error

Advertisement

MAtEM
Joined:
Posts:
2

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,587
Location:
Prague, Czechia

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)

Reply with quote

MAtEM
Joined:
Posts:
2

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

Reply with quote

Advertisement

You can post new topics in this forum