Script tries to reconnect instead of abort

Advertisement

JeroenE
Joined:
Posts:
9
Location:
The Netherlands

Script tries to reconnect instead of abort

I have a script which uploads files to an FTP server.

Sometimes the server is flaky and the upload doesn't work. I can't change that (it's not my server) and I can accept if the upload fails. However, for some reason WinSCP tries to reconnect to the server instead of aborting.

I would like to abort this reconnection automatically or after some time so I know this has failed. Now winscp is just retrying this endlessly. Because I'm waiting on the result everything else is waiting until someone comes along and chooses abort.

This is how the script is started:
winscp.exe /console /timeout=60 /xmllog="mylogfile.xml" /script="myscript.script"
This is the contents of the script file:
option batch abort
option confirm off
open -passive=on FTP://user:password@ftpserver
option transfer binary
option batch abort
option confirm off
put -delete "C:\directory\myfile" "/remotedirectory/"
exit
Attached a screen shot to show what is happening on the screen.

I had assumed that the "option batch abort" would choose automatically for the abort option, but it chooses reconnect instead. Am I missing some setting or is there some way to abort these retries?

reconnect.png

Reply with quote

Advertisement

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

Re: Script tries to reconnect instead of abort

Use option reconnecttime X to limit the retries to X seconds.

Though note that the latest version of WinSCP defaults to 120 seconds.

So maybe you just need to upgrade.

Reply with quote

JeroenE

Thanks, we'll try the latest version and set the reconnecttime in the script.
Unfortunately this is difficult to test as we are depending on a remote server not workign as it should :roll:

Reply with quote

JeroenE
Joined:
Posts:
9
Location:
The Netherlands

Re: Script tries to reconnect instead of abort

martin wrote:

Use option reconnecttime X to limit the retries to X seconds.

Though note that the latest version of WinSCP defaults to 120 seconds.

So maybe you just need to upgrade.
It happened again. I used the latest release and the reconnecttime option.

WinSCP also keeps looping with the "trying to reconnect" prompt. It does not adhere to the reconnecttime timeout and is also does not adhere to the abort option.

I found a way to simulate this and that is to have an FTP server which only allows passive connections. When you try this without the passive option in WinSCP you get the same behaviour. Unfortuntaly I don't have my own FTP server so I can not give an account/password for you to try.

Is there some other way to get WinSCP to abort this endless retrying? Or is this a bug that has to be fixed?

Reply with quote

Advertisement

JeroenE
Joined:
Posts:
9
Location:
The Netherlands

Re: Script tries to reconnect instead of abort

martin wrote:

That's a known issue:
https://winscp.net/tracker/1169
Ok, I did not know that.

martin wrote:

But how does this affect you in reality? What happens with the server that suddenly causes the endless loop?
I don't know why this happens on the server. I don't control the server; I just need to send things there.

It affects me because WinSCP keeps retrying until forever. What I'm doing is starting WinSCP and when it is finished I read the logfile to see if everything went OK.

Because WinSCP never finishes this never happens and I never get an alert that something is wrong.

I'd rather have that WinSCP would fail in these conditions as then I can do something about it. Or at least I cen try to send the files differently etc. Now it is just doing this reconnect thing until someone notices that nothing gets sent anymore.

I'm not sending only to this server, but I'm sending things in turn. So if a process hangs then everything stops.

I switched to WinSCP because the ftp.exe of Microsoft is not reliable either (and they don't want to fix it).

Reply with quote

martin
Site Admin
martin avatar

Re: Script tries to reconnect instead of abort

I'm sending you an email with a development version of WinSCP to the address you have used to register on this forum.

Reply with quote

RDV
Guest

this issue still exists

i can confirm this issue still exists. Because of the endless loop the batch never goes to the next line in the script, thus never notifying of failure either..

Reply with quote

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

Re: this issue still exists

RDV wrote:

i can confirm this issue still exists. Because of the endless loop the batch never goes to the next line in the script, thus never notifying of failure either..
Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum