I've responded by an email.
- martin
I also noticed the file will hang in the GUI also once the problem starts. So basically even if I manually upload it will show those same errors in the GUI version. If it happens again on this new server I'll try to take some screenshots.
. 2020-09-10 08:00:20.356 Getting real path for '/'
> 2020-09-10 08:00:20.356 Type: SSH_FXP_REALPATH, Size: 10, Number: 272
< 2020-09-10 08:00:20.403 Type: SSH_FXP_NAME, Size: 49, Number: 272
. 2020-09-10 08:00:20.403 Real path is '/USERNAME'
. 2020-09-10 08:00:20.403 File: 'C:\WinSCP Scripts\Temp2\XXXXX.xml' [2020-09-09T20:37:08.500Z] [75239]
. 2020-09-10 08:00:20.403 Copying "C:\WinSCP Scripts\Temp2\XXXXX..xml" to remote directory started.
. 2020-09-10 08:00:20.403 Binary transfer mode selected.
. 2020-09-10 08:00:20.403 Opening remote file.
> 2020-09-10 08:00:20.403 Type: SSH_FXP_OPEN, Size: 62, Number: 515
< 2020-09-10 08:00:20.465 Type: SSH_FXP_HANDLE, Size: 33, Number: 515
> 2020-09-10 08:00:20.465 Type: SSH_FXP_WRITE, Size: 32813, Number: 1030
. 2020-09-10 08:00:20.465 2 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2020-09-10 08:00:20.465 Type: SSH_FXP_CLOSE, Size: 33, Number: 1796
> 2020-09-10 08:00:20.465 Type: SSH_FXP_SETSTAT, Size: 58, Number: 777
. 2020-09-10 08:00:36.870 Waiting for data timed out, asking user what to do.
. 2020-09-10 08:00:36.870 Asking user:
. 2020-09-10 08:00:36.870 **Host is not communicating for 15 seconds.
. 2020-09-10 08:00:36.870
. 2020-09-10 08:00:36.870 Wait for another 15 seconds?** ()
< 2020-09-10 08:00:36.870 Script: Host is not communicating for more than 15 seconds.
< 2020-09-10 08:00:36.870 Still waiting...
< 2020-09-10 08:00:36.870 Note: If the problem repeats, try turning off 'Optimize connection buffer size'.
< 2020-09-10 08:00:36.870 Warning: Aborting this operation will close connection!
. 2020-09-10 08:00:39.949 Data has arrived, closing query to user.
. 2020-09-10 08:00:39.949 Network error: Software caused connection abort
. 2020-09-10 08:00:39.949 Connection was lost, asking what to do.
. 2020-09-10 08:00:39.949 Asking user:
. 2020-09-10 08:00:39.949 Network error: Software caused connection abort ()
< 2020-09-10 08:00:39.949 Script: Network error: Software caused connection abort
# Load WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"
# Set up session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Sftp
HostName = "xxxx.com"
UserName = "XXXXXXSFTP"
SshHostKeyFingerprint = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
SshPrivateKeyPath = "C:\Program Files (x86)\WinSCP\SSH Key\XXXXXXXX\XXXXXXXXXXXKey.ppk"
}
$remotePath = "/"
$localPath = "C:\WinSCP Scripts\XXXXXXXXXXXX\Temp2\*"
$uploadSession = New-Object WinSCP.Session
$uploadSession.SessionLogPath = "C:\WinSCP Scripts\XXXXXXXXXXXXt\TEST-Upload.log"
try
{
# Connect
$uploadSession.Open($sessionOptions)
# Upload files
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferOptions.OverwriteMode = [WinSCP.OverwriteMode]::Overwrite
#Upload Files - localPath, remotePath, remove (true, deletes source local file(s) after a successful transfer)
$transferResult = $uploadSession.PutFiles($localPath, $remotePath, $False, $transferOptions)
# Print results
foreach ($transfer in $transferResult.Transfers){
Write-Host ("Upload of {0} succeeded" -f $transfer.FileName)
#Copy-Item $transfer.FileName -Destination "E:\XXXXXXXXXXXXXXXXXXX"
#Move-Item $transfer.FileName -Destination "\\XXXXXXXXXXXXX\Archive"
$transferResult | Out-File "C:\WinSCP Scripts\XXXXXXXXXXXX\TEST-TransferResult.log"
$transferResult.Transfers | Out-File "C:\WinSCP Scripts\XXXXXXXXXXXX\TEST-Transfers.log"
# Throw on any error
$transferResult.Check()
}
finally
{
$uploadSession.Dispose()
}
exit 0
catch
{
Write-Host "Error: $($_.Exception.Message)"
exit 1
}