Timeout waiting for external console to complete the command

Advertisement

RickB
Guest

Timeout waiting for external console to complete the command

I am getting the following Error:

"Timeout waiting for external console to complete the command"

I am using v3.8.2 (build 330).

I am running the following command (from WScript.Shell exec()):

winscp3.com /command "open xxxxx@yyyy" "cd /apps" "ls" "close" "exit"

If there are more than about ten files in the directory the command partially works (I get get part of the file listing) but times out before it completes.

Have tried using keepalives and setting server timeout to 120 but it hasn't helped.

Help?

Reply with quote

Advertisement

RickB
Guest

Re: Timeout waiting for external console to complete the com

martin wrote:

Can you post full output of the WinSCP?
Dobry den Martin

All I get is an alert dialog, the title says "Error" and the error is
"Timeout waiting for external console to complete the command."

Below is what I get in the log file:

Any idea how I could fix this?
Dekuji
Rick

. 2006-12-11 08:01:21.927 --------------------------------------------------------------------------
. 2006-12-11 08:01:21.937 WinSCP Version 3.8.2 (Build 330) (OS 5.1.2600 Service Pack 1)
. 2006-12-11 08:01:21.947 Login time: Monday, 11 December 2006 8:01:21 AM
. 2006-12-11 08:01:21.947 --------------------------------------------------------------------------
. 2006-12-11 08:01:21.947 Session name: xxxxxxx@xxxxxxxxx
. 2006-12-11 08:01:21.957 Host name: xxxxxxxxx (Port: 22)
. 2006-12-11 08:01:21.957 User name: xxxxxxx (Password: Yes, Key file: No)
. 2006-12-11 08:01:21.967 Transfer Protocol: SFTP (SCP)
. 2006-12-11 08:01:21.967 SSH protocol version: 2; Compression: No
. 2006-12-11 08:01:21.977 Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2006-12-11 08:01:21.977 Ciphers: aes,blowfish,3des,WARN,des; Ssh2DES: No
. 2006-12-11 08:01:21.977 Ping type: -, Ping interval: 15 sec; Timeout: 120 sec
. 2006-12-11 08:01:21.987 SSH Bugs: -,-,-,-,-,-,-,-
. 2006-12-11 08:01:21.987 SFTP Bugs: -,-,-
. 2006-12-11 08:01:21.987 Proxy: none
. 2006-12-11 08:01:21.997 Return code variable: Autodetect; Lookup user groups: Yes
. 2006-12-11 08:01:21.997 Shell: default, EOL: 0
. 2006-12-11 08:01:21.997 Local directory: G:\xxxxxx, Update: No, Cache: Yes
. 2006-12-11 08:01:22.007 Cache directory changes: Yes, Permanent: Yes
. 2006-12-11 08:01:22.007 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2006-12-11 08:01:22.007 Alias LS: No, Ign LS warn: Yes, Scp1 Comp: No
. 2006-12-11 08:01:22.017 --------------------------------------------------------------------------
. 2006-12-11 08:01:22.017 Looking up host "xxxxxxxxx"
. 2006-12-11 08:01:22.057 Connecting to xxx.xxx.xxx.xxx port 22
. 2006-12-11 08:01:22.087 Server version: SSH-1.99-OpenSSH_4.3p2-hpn
. 2006-12-11 08:01:22.087 We claim version: SSH-2.0-WinSCP_release_3.8.2
. 2006-12-11 08:01:22.097 Using SSH protocol version 2
. 2006-12-11 08:01:22.107 Doing Diffie-Hellman group exchange
. 2006-12-11 08:01:22.117 Doing Diffie-Hellman key exchange
. 2006-12-11 08:01:22.538 Host key fingerprint is:
. 2006-12-11 08:01:22.538 ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
. 2006-12-11 08:01:22.538 Initialised AES-256 client->server encryption
. 2006-12-11 08:01:22.548 Initialised HMAC-SHA1 client->server MAC algorithm
. 2006-12-11 08:01:22.558 Initialised AES-256 server->client encryption
. 2006-12-11 08:01:22.568 Initialised HMAC-SHA1 server->client MAC algorithm
! 2006-12-11 08:01:22.638 Using username "xxxxxxx".
! 2006-12-11 08:01:22.648 SECURITY NOTICE
! 2006-12-11 08:01:22.658 Use of this system, its equipment, and resources is monitored at all
! 2006-12-11 08:01:22.668 times. All programs and information held on this system are private and
! 2006-12-11 08:01:22.668 confidential, and are only lawfully available to authorised users for
! 2006-12-11 08:01:22.668 authorised purposes only.
! 2006-12-11 08:01:22.688 It is a criminal offence to obtain unauthorised access to any program
! 2006-12-11 08:01:22.688 or information within this system and/or to make any unauthorised
! 2006-12-11 08:01:22.698 modifications whatsoever to the contents of this computer system.
! 2006-12-11 08:01:22.698 If you are not an authorised user you are violating the regulations of
! 2006-12-11 08:01:22.698 this system and can, and will be prosecuted to the full extent of the
! 2006-12-11 08:01:22.708 law. Please disconnect immediately.
. 2006-12-11 08:01:22.708 Keyboard-interactive authentication refused
. 2006-12-11 08:01:22.708 Session password prompt (xxxxxxx@xxxxxxxxx's password: )
. 2006-12-11 08:01:22.718 Using stored password.
! 2006-12-11 08:01:22.718 Authenticating with pre-entered password.
. 2006-12-11 08:01:22.718 Sent password
. 2006-12-11 08:01:22.728 Access granted
. 2006-12-11 08:01:22.739 Opened channel for session
. 2006-12-11 08:01:22.749 Started a shell/command
. 2006-12-11 08:01:22.749 --------------------------------------------------------------------------
. 2006-12-11 08:01:22.749 Using SFTP protocol.
. 2006-12-11 08:01:22.759 Doing startup conversation with host.
> 2006-12-11 08:01:22.759 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2006-12-11 08:01:22.769 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2006-12-11 08:01:22.769 SFTP version 3 negotiated.
. 2006-12-11 08:01:22.769 We believe the server has signed timestamps bug
. 2006-12-11 08:01:22.779 We will use UTF-8 strings for status messages only
. 2006-12-11 08:01:22.779 Limiting packet size to OpenSSH limit of 262148 bytes
. 2006-12-11 08:01:22.789 Changing directory to "/apps/xxx".
. 2006-12-11 08:01:22.789 Getting real path for '/apps/xxx'
> 2006-12-11 08:01:22.789 Type: SSH_FXP_REALPATH, Size: 57, Number: 16
< 2006-12-11 08:01:22.799 Type: SSH_FXP_NAME, Size: 117, Number: 16
. 2006-12-11 08:01:22.799 Real path is '/apps/xxx'
. 2006-12-11 08:01:22.809 Trying to open directory "/apps/xxx".
> 2006-12-11 08:01:22.809 Type: SSH_FXP_LSTAT, Size: 57, Number: 263
< 2006-12-11 08:01:22.819 Type: SSH_FXP_ATTRS, Size: 37, Number: 263
. 2006-12-11 08:01:22.819 Getting current directory name.
. 2006-12-11 08:01:22.819 Startup conversation with host finished.
. 2006-12-11 08:01:22.849 Cached directory change via "/apps/xxx" to "/apps/xxx".
. 2006-12-11 08:01:22.849 Getting current directory name.
. 2006-12-11 08:01:22.849 Listing directory "/apps/xxx".
> 2006-12-11 08:01:22.859 Type: SSH_FXP_OPENDIR, Size: 57, Number: 523
< 2006-12-11 08:01:22.859 Type: SSH_FXP_HANDLE, Size: 13, Number: 523
> 2006-12-11 08:01:22.919 Type: SSH_FXP_READDIR, Size: 13, Number: 780
< 2006-12-11 08:01:22.939 Type: SSH_FXP_NAME, Size: 15949, Number: 780
> 2006-12-11 08:01:22.949 Type: SSH_FXP_READDIR, Size: 13, Number: 1036
< 2006-12-11 08:01:22.949 Type: SSH_FXP_STATUS, Size: 28, Number: 1036
< 2006-12-11 08:01:22.959 Status/error code: 1
> 2006-12-11 08:01:22.959 Type: SSH_FXP_CLOSE, Size: 13, Number: 1284
. 2006-12-11 08:01:32.996 Closing connection.

Reply with quote

martin
Site Admin
martin avatar

Re: Timeout waiting for external console to complete the com

Can I have a contact to you, so I can send you a debug version?

Reply with quote

RickB
Guest

my contact

Hi Martin
That would be great.

My email is:

REMOVETHIS r i c k . b r o w n ZNAK i m m i . g o v . a u ANDREMOVETHIS

I dare not post my email address in its pure form here, you'll have to remove the spaces etc.

Cheers
Rick

Reply with quote

Advertisement

RickB
Joined:
Posts:
2
Location:
Australia

Kick me

Hi Martin

Thanks for the debug version.

I thought I should let you know that I have found the bug and it wasn't WinSCP!

Thanks again Martin.
Cheers
Rick

If you want a more detailed explanation of the bug, read on:
I was launching WinSCP like this:

var objShell = new ActiveXObject("WScript.Shell");
var objWshScriptExec = objShell.Exec(prog);

I was then trying to read stdErr and stdOut like this:

while(!objWshScriptExec.StdErr.AtEndOfStream)
{
strOutput += "\n" + objWshScriptExec.StdErr.ReadAll();
}

while(!objWshScriptExec.StdOut.AtEndOfStream)
{
strOutput += "\n" + objWshScriptExec.StdOut.ReadAll();
}


Anyway, the script would hang reading stdErr when there were a lot of files being processed by WinSCP. The moment I stopped reading stdErr the script (and WinSCP) ran perfectly!

The problem was reported by WinSCP (I think it would timeout because suddenly it could not write to stdErr or stdOut anymore) which is why it seemed like a WinSCP bug.

Reply with quote

martin
Site Admin
martin avatar

Re: Kick me

RickB wrote:

The problem was reported by WinSCP (I think it would timeout because suddenly it could not write to stdErr or stdOut anymore) which is why it seemed like a WinSCP bug.
Thanks for letting me know!

Reply with quote

Guest

I actually think there IS a bug, but maybe it's corrected?

Hi Martin

First ... thx. for a GREAT program. I'll try to make my company donate.

Second.. I actually think there IS a bug - at least in 3.8.0.

I have exactly the same problem as reported here if ALL the following is true:
1. I use a script to execute the command line. (In my case PrintNetT script)
2. If there are more than between 42 and 59 files to be sent, using "*.*" from a directory. - I haven't narrowed it down more than this. If I have fewer than 42 files in the directory there is no problem.
3. If I try to read the ouput lines generated from WinSCP.

I do not get the problem if
1. There are fewer files than approx. 42.
2. If I use a windows command prompt only with exactly the same command.

By the way - the command I call from the script is this:
winSCP3 mySessionID /command "option batch abort" "option confirm off" "put mydir\*.*" close exit /log="c:\SFTPlogDag&amp;D.txt"

I think WinSCP tries to access the shell or something after sending the 42 (or perhaps 58) files.

I don't really need to read the response, so I can live with this, but I thought that you'd like to know that there is an issue here.

thx. again for a truly great program. - I am pleased to see that you have implemented FTP. I didn't know that untill I had this problem, so I guess that something good have come out of this for me.

Best Regards
Henrik Noerby

martin wrote:

RickB wrote:

The problem was reported by WinSCP (I think it would timeout because suddenly it could not write to stdErr or stdOut anymore) which is why it seemed like a WinSCP bug.
Thanks for letting me know!

Reply with quote

Advertisement

pshaw
Guest

same error

I'm new to scripting winscp, I'm running this in task scheduler:
WinSCP.com /script=completed_sync_script.txt sync
Here's the script:
option synchdelete on
option confirm off
option batch continue
synchronize local "C:\sync directory" "sync"

The script runs for an hour and is then terminated by the scheduler.
It repeats this routine every hour.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: same error

pshaw wrote:

The script runs for an hour and is then terminated by the scheduler.
It repeats this routine every hour.
You are missing "exit" command at the end.

Reply with quote

pshaw
Guest

Re: same error

martin wrote:


You are missing "exit" command at the end.
is there any way to time delay the exit command?

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: same error

pshaw wrote:

is there any way to time delay the exit command?
Not directly. But you can call remote command that causes delays. The simplest would be "call sleep 10".

Reply with quote

Sunil Somani
Guest

Timeout waiting for external console to complete the com

Hi Prikryl et'al,

I have recently moved to WinSCP.
And when I need to download some file not more than 10 even, I am getting same error.
I am attaching the terminal output for your reference.
Please advise as its quite critical for me.

C:\Program Files\WinSCP>"C:\Program Files\WinSCP\winscp" /console -script=ftpSG
X091207.txt /log=SGXNightLog.txt
batch on
confirm off
Searching for host...
Connecting to host...
Authenticating...
Using username "sshdcs25001".
Authenticating with public key "rsa-key-20090915".
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] sshdcs25001@167.168.15.26
/SUNIL/091207
TransferFile1 | 57 KiB | 11.9 KiB/s | binary | 100%
TransferFile2 | 57 KiB | 11.1 KiB/s | binary | 100%
TransferFile3 | 57 KiB | 10.6 KiB/s | binary | 100%
TransferFile4 | 57 KiB | 9.6 KiB/s | binary | 100%
TransferFile5 | 71 KiB | 11.1 KiB/s | binary | 100%
TransferFile6 | 71 KiB | 13.5 KiB/s | binary | 100%
TransferFile7 | 71 KiB | 15.6 KiB/s | binary | 100%
TransferFile8 | 71 KiB | 16.5 KiB/s | binary | 100%
TransferFile9 | 112 KiB | 13.5 KiB/s | binary | 100%
TransferFile10 | 112 KiB | 11.3 KiB/s | binary | 100%
TransferFile11 | 112 KiB | 12.9 KiB/s | binary | 100%
TransferFile12 | 0 KiB | 12.9 KiB/s | binary | 0%
Timeout waiting for external console to complete the command.

Timeout waiting for external console to complete the command.


Could you please advise what can I do to avoid such issue.
There are not even too large number of file not even in size.

Thanks
Sunil Somani

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Timeout waiting for external console to complete the com

Sunil Somani wrote:

Could you please advise what can I do to avoid such issue.
There are not even too large number of file not even in size.
Have you checked the tracker link above?

Reply with quote

Sunil Somani
Guest

RE:Timeout waiting for external console to complete the com

Hi,

Yes, I read. And I guess you are referring "Henrik Noerby"'s reposne.
However I am not really clear what should I avoid to resolve this issue.
As its not frequent and second its not even exit, until someone hit enter or some action on the command prompt.

I don't have files more than 42, infact so far less then 20 only.

Please advise.

Thanks
Sunil Somani

Reply with quote

Advertisement

MCS
Joined:
Posts:
1

I am getting the following Error:

"Timeout waiting for external console to complete the command".
I try to use WinSCP (Version 4.2.7 Bilid 758) as a process object in my .Net 3.5 program. I get a pop-up dialog with the above message on random basis.
CODE:
Dim winscp As Process = New Process
winscp.StartInfo.FileName = "ApplicationPath\winscp.com"
winscp.StartInfo.UseShellExecute = False
winscp.StartInfo.RedirectStandardInput = True
winscp.StartInfo.RedirectStandardOutput = True
winscp.StartInfo.CreateNoWindow = True

winscp.Start()
winscp.StandardInput.WriteLine("option batch abort")
winscp.StandardInput.WriteLine("option confirm off")
winscp.StandardInput.WriteLine(String.Format("open {0}://{1}:{2}@{3}:{4} -timeout=100", "SFTP", Username, Password, Hostname, PortNumber))

winscp.StandardInput.WriteLine(String.Format("cd {0}", RemotePath))
winscp.StandardInput.WriteLine(String.Format("lcd {0}", LocalPath))
winscp.StandardInput.WriteLine("get " + FileName + "")
winscp.StandardInput.WriteLine("close")
winscp.StandardInput.WriteLine("exit")
winscp.StandardInput.Close()
Output = winscp.StandardOutput.ReadToEnd()
winscp.WaitForExit()

Please provide solution to this problem.
Thanks

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

MCS wrote:

I am getting the following Error:

"Timeout waiting for external console to complete the command".
I try to use WinSCP (Version 4.2.7 Bilid 758) as a process object in my .Net 3.5 program. I get a pop-up dialog with the above message on random basis.
I have sent you a debug version.

Reply with quote

Carlos Cuenca
Guest

I am getting the same error

I run winscp from a windows shell script with the following command:

Set shell = WScript.CreateObject("WScript.Shell")
Set ejecucion=shell.Exec("C:\PROGRA~2\WinSCP\winscp.com /log="+fichero+".xml /script=script.txt")

Do While ejecucion.Status = 0
WScript.Sleep 3000
Loop

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: I am getting the same error

Carlos Cuenca wrote:

I run winscp from a windows shell script with the following command:

Set shell = WScript.CreateObject("WScript.Shell")
Set ejecucion=shell.Exec("C:\PROGRA~2\WinSCP\winscp.com /log="+fichero+".xml /script=script.txt")

Do While ejecucion.Status = 0
WScript.Sleep 3000
Loop
If your script has long output, then it is probably still the same problem
I have updated the WSH example with alternative code not suffering the problem.

Reply with quote

Advertisement

You can post new topics in this forum