Timeout waiting for external console to complete the command

Advertisement

filipd
Joined:
Posts:
5

Timeout waiting for external console to complete the command

Hello

I have a PS script (using WinSCP .NET assembly) to synchronize a directory between Windows (target) and Linux (source).
Most of the time, the script fails with the following error message :

2016-01-17 23:27:08.238 Type: SSH_FXP_CLOSE, Size: 13, Number: 236635908
* 2016-01-17 23:27:08.613 (ECommand) **Copying files from remote side failed.**
* 2016-01-17 23:27:08.613 Timeout waiting for external console to complete the command.
< 2016-01-17 23:27:08.613 Script: Copying files from remote side failed.
< 2016-01-17 23:27:08.676 Script: Timeout waiting for external console to complete the command.
. 2016-01-17 23:27:08.769 Script: Failed
> 2016-01-17 23:27:19.551 Script: exit
. 2016-01-17 23:27:19.566 Script: Exit code: 1
. 2016-01-17 23:27:19.566 Closing connection.
. 2016-01-17 23:27:19.629 Sending special code: 12
. 2016-01-17 23:27:19.629 Sent EOF message


The logfile can be found in attachment.
Thanks for helping me out

Filip
  • copy.zip (866.37 KB, Private file)
Description: file compressed using 7-zip

Reply with quote

Advertisement

filipd
Joined:
Posts:
5

Hello

Job failed again last night.
New log to be found in attachment.

Br

Filip
  • copy20160119.log (892.64 KB, Private file)

Reply with quote

Advertisement

filipd
Joined:
Posts:
5

Timeout set to 0 ?
I've lost you there : the code looks as follows :

try
{
# Load WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WINSCP\WinSCPnet.dll"

# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
$sessionOptions.HostName = "XXXXXXX"
$sessionOptions.UserName = "XXXXXXX"
$sessionOptions.Password = "XXXXXXX"
$sessionOptions.Timeout = 300
$sessionOptions.SshHostKeyFingerprint = "ssh-rsa XXXXXX"


$session = New-Object WinSCP.Session

try
{
# Connect
$session.ExecutablePath = "C:\Program Files (x86)\WINSCP\winscp.exe"
$Session.SessionLogPath = "C:\Scripts\copy.log"
# $Session.DebugLogPath = "C:\Scripts\copydebug.log"
$session.Open($sessionOptions)

# Synchronize files
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferOptions.SpeedLimit = 6000

$transferResult_Data = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Local, "E:\PRD_BACKUPS\DATA\", "/hana/hana-backup/PRD/data/",$true,$false,[WinSCP.SynchronizationCriteria]::Time,$transferOptions)
$transferResult_Data.Check()
$transferResult_Logs = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Local, "E:\PRD_BACKUPS\LOGS\", "/hana/hana-backup/PRD/log/",$true,$false,[WinSCP.SynchronizationCriteria]::Time,$transferOptions)
$transferResult_Logs.Check()


}
finally
{
# Disconnect, clean up
$session.Dispose()
}
Send-MailMessage -From "hostname" -To "XXXXXXXXX" -Subject "synchronization of backupfiles (DATA & LOGS) from <hostname> to <hostname> finished OK" -SmtpServer "yyy"
exit 0
}
catch [Exception]
{
$ErrorMessage = $_.Exception.Message
Send-MailMessage -From "hostname" -To "XXXXXXXXX" -Subject "synchronization of backupfiles (DATA or LOGS) from <hostname> to <hostname> FAILED !" -SmtpServer "yyy" -Body "Error message is $ErrorMessage"
exit 1
}

Reply with quote

martin
Site Admin
martin avatar

The SessionOptions.Timeout is of type TimeSpan.

The 300 gets converted by PowerShell to TimeSpan 00:00:00.0000300 what rounds to zero later.

Reply with quote

Advertisement

You can post new topics in this forum