Closed shaunm001 closed 11 months ago
How long into the copy process does it run for before throwing the exception? I have a feeling this may have to be brought to the attention of the WinSCP devs. This is just a PowerShell wrapper around the .net assembly.
Looks like about 3 - 4 min after the command is run.
My only suggestion is to try the -TimeOut
option in New-WinSCPSessionOption
. If that doesn't work, we are going to have to get the WinSCP devs involved to help on that.
Awesome, I'll give that try, thanks!
Did that work for you?
I set the timeout value to 600 and am not getting timeout errors anymore, so that's good. However I do notice now that the copy job is running extremely slow; so slow that its still running when the job starts again the following evening (so runs for over 24 hours). It's struck trying to move an 8GB file. When I use the regular WinSCP windows app to move the file, it copies in a few minutes.
I know that's a completely different issue, but any thoughts on that, ha...
Im thinking that something you are going to have to open up on the WinSCP forum. Or it maybe an issue with your flavor of FTP Server. Good luck.
@shaunm001 Haven't you enabled verbose logging while debugging the original issue? That would slow down the operation. https://winscp.net/eng/docs/faq_slow#logging
If not, collect session log files (both from code and GUI) and post them on WinSCP support forum
Hey Martin, I did not have verbose logging enabled. I see how to do that in the WinSCP windows app (GUI), but not sure how to enable logging in the PowerShell script using the WinSCP module?
see the help doc for New-WinSCPSession
https://github.com/tomohulk/WinSCP/blob/master/Help/New-WinSCPSession.md.
-DebugLogLevel
-DebogLogPath
-SessionLogPath
-XmlLogPath
-XmlLogPreserve
Please fill in the following fields:
Issue Description
I have a scheduled powershell script running Sync-WinSCPPath cmdlet that regularly times out. The timeout occurs with files about 8GB in size.
Example
Sync-WinSCPPath -WinSCPSession $WinSCPSession -Mode Local -LocalPath "D:\LocalPath" -RemotePath "/mnt/remotePath" -Remove
Expected Output
Expect new files to be copied to local path, old (missing) files to be deleted from local path
Actual Output
I receive an error: "Exception calling "SynchronizeDirectories" with "7" argument(s): "Timeout waiting for WinSCP to respond""
WinSCP-PowerShell Version
6.1.1.0
Environment
Windows Server 2016 x64, powershell version 5.1.17763.4840