Timeout while waiting on server to respond when running scri

Advertisement

BVD
Guest

Timeout while waiting on server to respond when running scri

Hello,

Apologies if this question has been asked before, but I am experiencing a problem when running a script using WinSCP 4.1.5.

To explain a little without going into details, when running the script it will use a "call" command to execute a series of commands on the server. Unfortunately, some of these commands are extremely slow. (this can't be changed unfortunately)

When running these commands, it can happen regularly that it suddenly decides to time out and not continue further with the script.

An example of the script being run:

option batch continue
open Server1
call source remotescript1.sh
call source remotescript2.sh
get -delete output1.tar.gz "\\local-server\storage\"
get -delete output2.tar.gz "\\local-server\storage\"
close
exit

When looking at the logs, it seems to run fine, but suddenly it disconnects with a message stating the server timed out and it doesn't continue.

What I've tried as well is to open and close the session after each "call" command but if it loses connection ones it doesn't recover anymore.

The session in WinSCP's GUI is set up to have a timeout of the maximum allowed 6000 seconds, but this doesn't seem to help.

Any advice on this issue would be greatly appreciated.

Thanks.

Reply with quote

Advertisement

JRB_BMB
Joined:
Posts:
24
Location:
Midlands, UK

Tried breaking down the scripts into smaller more executable chunks maybe?
This would at least increase the server responses hopefully preventing the time out; okay so the caveat is you have to have maybe twice as many scripts but if its a copy and paste job pretty much is it really that bad?

Could always just look into your scripts and see what the delay is and why; sometimes there's not much you can do but you'd be surprised what a bit of re-ordering or re-thinking on certain bits can do to lighten the load overall and speed things up.

Good luck anyway!
JRB

Reply with quote

BVD
Guest

JRB_BMB wrote:

Tried breaking down the scripts into smaller more executable chunks maybe?
This would at least increase the server responses hopefully preventing the time out; okay so the caveat is you have to have maybe twice as many scripts but if its a copy and paste job pretty much is it really that bad?

Could always just look into your scripts and see what the delay is and why; sometimes there's not much you can do but you'd be surprised what a bit of re-ordering or re-thinking on certain bits can do to lighten the load overall and speed things up.

Good luck anyway!
JRB
This is something I've tried already - unfortunately it all comes down to the server's performance as well in the end. On another server the same functions prove to be no problems and no timeouts occur.

When running the similar script using Putty, there is no timeout.

Reply with quote

JRB_BMB
Joined:
Posts:
24
Location:
Midlands, UK

Would it be worth looking into what other processes are running on this server then?
I presume the server boxes are the same capability wise; so maybe resource when you're timing this set of actions is being done at the same time the server has another scheduled task going on zapping both processes. So maybe some 'tweaking' of your timing may help.
Hardware is a very political territory - every man and his dog have opinions - so it's case of looking at your system and doing what you feel is necessary. Thus why I'm not gonna comment on it!

Bar that look at what resources the server does have and how they're being used. I always find a virus scan, spyware scan, a chkdsk and a defrag an easy maintenance task to perform before getting nitty gritty.


No offence but if it works with Putty; why so determined to make it work with winSCP? Just curious not being rude! :o)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,464
Location:
Prague, Czechia

Re: Timeout while waiting on server to respond when running scri

BVD wrote:

When running these commands, it can happen regularly that it suddenly decides to time out and not continue further with the script.
Can you post an exact message? Full output of the script may be useful.
_________________
Martin Prikryl

Reply with quote

Advertisement

BVD
Guest

The servers are, as far as I know, not using the same specs which does explain the differences in the load on them.

To answer the question why using WinSCP - this is the program we use here for multiple operations so it'd be easier to use this than to move to a different solution.

Here are the last lines of the log file where it got to the end of running a script:
. 2008-08-04 10:17:04.974 [Shell] Startup conversation with host finished.
. 2008-08-04 10:17:04.974 Executing user defined command on command session.
> 2008-08-04 10:17:04.974 [Shell] source remotescript1.sh ; echo "WinSCP: this is end-of-file:$?"
< 2008-08-04 11:05:52.332 [Shell] output.csv
< 2008-08-04 11:05:52.629 [Shell] WinSCP: this is end-of-file:0
> 2008-08-04 11:05:52.644 [Shell] pwd ; echo "WinSCP: this is end-of-file:$?"
< 2008-08-04 11:05:52.691 [Shell] /home/user/output
< 2008-08-04 11:05:52.691 [Shell] WinSCP: this is end-of-file:0
. 2008-08-04 11:05:52.691 Cached directory change via "/home/user/output" to "/home/user/output".
. 2008-08-04 11:05:52.691 Getting current directory name.
. 2008-08-04 11:05:52.691 Getting current directory name.
. 2008-08-04 11:05:52.691 Received disconnect message (protocol error)
. 2008-08-04 11:05:52.691 Disconnection message text: Timeout, your session not responding.
. 2008-08-04 11:05:52.691 Server sent disconnect message
. 2008-08-04 11:05:52.691 type 2 (protocol error):
. 2008-08-04 11:05:52.691 "Timeout, your session not responding."
. 2008-08-04 11:05:52.691 [Shell] Closing connection.
. 2008-08-04 11:05:52.691 [Shell] Sending special code: 12
. 2008-08-04 11:05:52.691 [Shell] Sent EOF message

It does run it's script and everything completes, but when it is to move on to the next step it disconnects despite having a valid connection. If it's WinSCP or the server causing the disconnect, I do not know.

I tried fixing this by having a "close" followed by an "open" after each command but that does not seem to work all the time either.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,464
Location:
Prague, Czechia

Can you post a complete log file?
_________________
Martin Prikryl

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,464
Location:
Prague, Czechia

Godai wrote:

Here's one. We are using WinSCP to update our game server source + patch data and sometimes rebuild the servers via a script.
This script can be very slow and WinSCP times out after a random period of time. See the log for two consecutive runs :)
You can set longer timeout:
open -timeout=60
_________________
Martin Prikryl

Reply with quote

Advertisement

Guest

martin wrote:

Godai wrote:

Here's one. We are using WinSCP to update our game server source + patch data and sometimes rebuild the servers via a script.
This script can be very slow and WinSCP times out after a random period of time. See the log for two consecutive runs :)
You can set longer timeout:
open -timeout=60
Cool thanks. What is the maximum timeout value?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,464
Location:
Prague, Czechia

Cool thanks. What is the maximum timeout value?
There's no limit.
_________________
Martin Prikryl

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,464
Location:
Prague, Czechia

Re: how do you set the time out?

p1nk g33k wrote:

how do you change the time out value?
Please read documentation. If that does not help, come back.
_________________
Martin Prikryl

Reply with quote

Advertisement

unknown
Guest

Domain trust issue

This is a domain trust issue
if your client is not in the same domain as the server, there will be similar logs as you show here

try trusting the other domain, or join client to server domain, or create DNS sub domains to be trusted by parent dns domains

Reply with quote

rizutov
Guest

Waiting for data timed out, asking user what to do.

Hi, I try to synch local folder with remote ftp folder:
There is an ftp folder where every day every 15 mins new files are put automatically. I have server with local folder which should contain the same files. I wrote a script which copies all this files from FTP to this local folder:
C:\bat\ftp\WinScp\winscp.exe /console /script=ftp_connect.txt

ftp_connect.txt:
option batch on
option confirm off
option transfer automatic
open user:pass@194.154.80.6:21 -passive -timeout=60
synchronize local D:\ftp /remote_folder/
close
exit

But it doesn't work when I launch my script. However when I try it through GUI winscp it works
This is logged when I connect using GUI:
. 2011-02-01 09:13:20.580 WinSCP Version 4.2.9 (Build 938) (OS 5.2.3790 Service Pack 2)
. 2011-02-01 09:13:20.580 Login time: 1 Февраль 2011 г. 9:13:20
. 2011-02-01 09:13:20.580 --------------------------------------------------------------------------
. 2011-02-01 09:13:20.580 Session name: user@194.154.80.6
. 2011-02-01 09:13:20.580 Host name: 194.154.80.6 (Port: 21)
. 2011-02-01 09:13:20.580 User name: ALGLExport (Password: Yes, Key file: No)
. 2011-02-01 09:13:20.580 Tunnel: No
. 2011-02-01 09:13:20.580 Transfer Protocol: SFTP (SCP)
. 2011-02-01 09:13:20.580 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2011-02-01 09:13:20.580 Proxy: none
. 2011-02-01 09:13:20.580 SSH protocol version: 2; Compression: No
. 2011-02-01 09:13:20.580 Bypass authentication: No
. 2011-02-01 09:13:20.580 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2011-02-01 09:13:20.580 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2011-02-01 09:13:20.580 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2011-02-01 09:13:20.580 SFTP Bugs: -,-
. 2011-02-01 09:13:20.580 Return code variable: Autodetect; Lookup user groups: Yes
. 2011-02-01 09:13:20.580 Shell: default
. 2011-02-01 09:13:20.580 EOL: 0, UTF: 2
. 2011-02-01 09:13:20.580 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2011-02-01 09:13:20.580 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2011-02-01 09:13:20.580 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2011-02-01 09:13:20.580 Cache directory changes: Yes, Permanent: Yes
. 2011-02-01 09:13:20.580 DST mode: 1
. 2011-02-01 09:13:20.580 --------------------------------------------------------------------------

And this was logged while trying batch file:

. 2011-02-01 09:13:20.580 Looking up host "194.154.80.6"
. 2011-02-01 09:13:20.580 Connecting to 194.154.80.6 port 21
. 2011-02-01 09:13:35.595 Waiting for data timed out, asking user what to do.
. 2011-02-01 09:13:35.595 Asking user:
. 2011-02-01 09:13:35.595 Host is not communicating for 15 seconds.
. 2011-02-01 09:13:35.595 
. 2011-02-01 09:13:35.595 Wait for another 15 seconds? ()
. 2011-02-01 09:13:35.595 Attempt to close connection due to fatal exception:
* 2011-02-01 09:13:35.595 Terminated by user.
. 2011-02-01 09:13:35.595 Closing connection.
. 2011-02-01 09:13:35.595 Sending special code: 12

By the way, I tried to change password and username entries. And this didn't change anything. This means the problem is in connection i.e. in "open" string. But still I can not figure what it says by


"Waiting for data timed out, asking user what to do.
. 2011-02-01 09:13:35.595 Asking user:
"

I would appreciate any help. Thanks in advance.

Reply with quote

kris123
Guest

Re: Waiting for data timed out, asking user what to do.

I have the same issue..can you pl explain how it was resolved?

Anonymous wrote:

rizutov wrote:

Hi, I try to synch local folder with remote ftp folder:
There is an ftp folder where every day every 15 mins new files are put automatically. I have server with local folder which should contain the same files. I wrote a script which copies all this files from FTP to this local folder:
C:\bat\ftp\WinScp\winscp.exe /console /script=ftp_connect.txt

ftp_connect.txt:
option batch on
option confirm off
option transfer automatic
open user:pass@194.154.80.6:21 -passive -timeout=60
synchronize local D:\ftp /remote_folder/
close
exit

But it doesn't work when I launch my script. However when I try it through GUI winscp it works
This is logged when I connect using GUI:
. 2011-02-01 09:13:20.580 WinSCP Version 4.2.9 (Build 938) (OS 5.2.3790 Service Pack 2)
. 2011-02-01 09:13:20.580 Login time: 1 ������� 2011 �. 9:13:20
. 2011-02-01 09:13:20.580 --------------------------------------------------------------------------
. 2011-02-01 09:13:20.580 Session name: user@194.154.80.6
. 2011-02-01 09:13:20.580 Host name: 194.154.80.6 (Port: 21)
. 2011-02-01 09:13:20.580 User name: ALGLExport (Password: Yes, Key file: No)
. 2011-02-01 09:13:20.580 Tunnel: No
. 2011-02-01 09:13:20.580 Transfer Protocol: SFTP (SCP)
. 2011-02-01 09:13:20.580 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2011-02-01 09:13:20.580 Proxy: none
. 2011-02-01 09:13:20.580 SSH protocol version: 2; Compression: No
. 2011-02-01 09:13:20.580 Bypass authentication: No
. 2011-02-01 09:13:20.580 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2011-02-01 09:13:20.580 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2011-02-01 09:13:20.580 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2011-02-01 09:13:20.580 SFTP Bugs: -,-
. 2011-02-01 09:13:20.580 Return code variable: Autodetect; Lookup user groups: Yes
. 2011-02-01 09:13:20.580 Shell: default
. 2011-02-01 09:13:20.580 EOL: 0, UTF: 2
. 2011-02-01 09:13:20.580 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2011-02-01 09:13:20.580 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2011-02-01 09:13:20.580 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2011-02-01 09:13:20.580 Cache directory changes: Yes, Permanent: Yes
. 2011-02-01 09:13:20.580 DST mode: 1
. 2011-02-01 09:13:20.580 --------------------------------------------------------------------------

And this was logged while trying batch file:

. 2011-02-01 09:13:20.580 Looking up host "194.154.80.6"
. 2011-02-01 09:13:20.580 Connecting to 194.154.80.6 port 21
. 2011-02-01 09:13:35.595 Waiting for data timed out, asking user what to do.
. 2011-02-01 09:13:35.595 Asking user:
. 2011-02-01 09:13:35.595 Host is not communicating for 15 seconds.
. 2011-02-01 09:13:35.595 
. 2011-02-01 09:13:35.595 Wait for another 15 seconds? ()
. 2011-02-01 09:13:35.595 Attempt to close connection due to fatal exception:
* 2011-02-01 09:13:35.595 Terminated by user.
. 2011-02-01 09:13:35.595 Closing connection.
. 2011-02-01 09:13:35.595 Sending special code: 12

By the way, I tried to change password and username entries. And this didn't change anything. This means the problem is in connection i.e. in "open" string. But still I can not figure what it says by


"Waiting for data timed out, asking user what to do.
. 2011-02-01 09:13:35.595 Asking user:
"

I would appreciate any help. Thanks in advance.
NNOw it works. Sorry

Reply with quote

Advertisement

You can post new topics in this forum