Occasional hang

Advertisement

hadrien
Joined:
Posts:
7

Occasional hang

I have a scheduled task (every 2 minutes) which calls via a Perl script WinSCP to upload files using scripting, not the GUI.

Sometime WINSCP get stuck and doesn't exit (approximately one session every day). It is random and not related to a time of the day or another factor. I am also unable to reproduce it.

I am using WinSCP Version 5.5.5.4605 - Windows Server 2012.

The Perl part is like this one:

my $pobj;
my $cmdline="\"$winscppath\" /console /script=$script /log=$log";
Win32::Process::Create($pobj,
                        $winscppath,
                        $cmdline,
                        ,0,
                        DETACHED_PROCESS,
                        ".") || die "Create: $!";
do {
   $pobj>Wait(500)
   $pobj>GetExitCode($exitcode);
        if ($exitcode eq STILL_ACTIVE) {
      ...
        }
}while ($exitcode eq STILL_ACTIVE && timeout);

The winscp script ($script file above) looks like:
option batch abort
option confirm off
open SFTP://XXXX:YYY@server -hostkey="ssh-rsa XXXXXXX" -rawsettings compression=1
option transfer binary
cd FOLDER
Put file1.ftp file1.ftp
Put file2.ftp file2.ftp
exit


See Winscp.ini and log in attachment.

I hope that it can point to root cause, even though reproducing the issue is not clear. Is there something wrong in my configuration? Is there a work around? Many thanks.
  • winscp.log (8.12 KB, Private file)
Description: logs
  • winscp_ini.txt (10.97 KB, Private file)
Description: winscp.ini

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
Location:
Prague, Czechia

Re: Occasional hang

Please start by upgrading WinSCP to the latest version.
_________________
Martin Prikryl

Reply with quote

hadrien
Joined:
Posts:
7

Re: Occasional hang

I update to the lastest version 5.9.6. Unfortunately, I still get the same issue.

The Perl part and the config haven't been changes.

Please see an example of winscp new log in attachment.

Many thanks for looking at this.
  • winscp.log (8.34 KB, Private file)
Description: Winscp log v 5.9.6

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
Location:
Prague, Czechia

Re: Occasional hang

I have sent you an email with a debug version of WinSCP to the address you have used to register on this forum.

Reply with quote

Advertisement

hadrien
Joined:
Posts:
7

Re: Occasional hang

Thank you for your quick answer, I'll see how I can integrate it in our env to replicate the issue and keep you posted.

Reply with quote

Thomas_C
Guest

Hanging logs

Hi I'm Thomas, working with hadrien. We have been able to reproduce the issue with your debug version, you'll find log and trace there :
ftp://winscp_tests:winscp1234@www.mybreuil.com

Just to remind you the issue, we launched winscp through the win32::Process at 8:05, then last log in standard log happened at 08:07:01, and 08:11 in trace, but process remains STILL_ACTIVE until 08:35 when we manually killed after TIMEOUT.

The global context is a Scheduled Task.

Many thanks,
Thomas.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
Location:
Prague, Czechia

Re: Hanging logs

Thanks. I'm sending you a new build of the debug version.

Reply with quote

hadrien
Joined:
Posts:
7

Hi Martin,

we finally reproduce the issue with the new build. Seems to be related to a MessageDlg that popup even in command line... In attachment the logs. Thanks for your investigation.
  • winscp-20170830211006.log (202.46 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
Location:
Prague, Czechia

hadrien wrote:

Hi Martin,

we finally reproduce the issue with the new build. Seems to be related to a MessageDlg that popup even in command line... In attachment the logs. Thanks for your investigation.
It seems that some runs of the task overlap and they fight over an INI file.

Few possible solutions:
- Do not rely on an external configuration at all: https://winscp.net/eng/docs/scripting#configuration
- Set INI file read only: https://winscp.net/eng/docs/config#ini_readonly
- Use registry instead of an INI file

Reply with quote

Advertisement

You can post new topics in this forum