Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


WINSCP 4.2.5 intermittently reports false failures.

I have been testing winscp 4.2.5 with the intention of upgrading to it.

However, I have found an intermittent inconsistency in the exit code that winscp425.exe returns.

For test purposes, I have been doing a number of repeated puts using SFTP in a DOS script, transferring the same file (in_progress_SFTP_OUT.TXT.flagged) to the same location (DESTINATION). See below (note I have censored the connection detail for confidentiality).

.\%WINSCP_VERSION%.exe /log=%source_filename%.winscp.log /ini=WINSCP_VERSION%.ini /command [CONNECTION_DETAIL] "option batch on" "option confirm off" "binary" "lcd %source_directory%" "cd %target_directory%" "put %flagged_file% %transfered_file%" "mv %transfered_file% %source_filename%" exit

This works most of the time with winscp returning 0 but occasionally, winscp425.exe inexplicably returns 1, even though the transfer appears successful (in that - the file was transferred, the winscp log reports success and the server log reports success). This causes the automated script to halt and report failure.

For the failure incident, the script resolved to the following

./WINSCP425.exe /log=SFTP_OUT.TXT.winscp.log /ini=WINSCP425.ini /command [CONNECTION_DETAIL] "option batch on" "option confirm off" "binary" "lcd \\SBOJSYOPTST001\DATA$\DEV\WINSCPTESTS\SOURCE" "cd DESTINATION" "put in_progress_SFTP_OUT.TXT.flagged in_progress_SFTP_OUT.TXT.flagged" "mv in_progress_SFTP_OUT.TXT.flagged SFTP_OUT.TXT" exit

As you can see, winscp returned 1 indicating there was a problem. However, there does not appear to have been a problem. The transfer worked and the logs agree.

I am emailing you two logs the failure log (FAILED.SFTP_OUT.TXT.winscp.log) for the command above and an example of a log from a successful run (SUCCESS.SFTP_OUT.TXT.winscp.log). Comparing these, I found they appear to be in sync up to line 239. At that point, the following 4 lines appear in the failure log only -

. 2010-03-03 19:26:25.200 Timeout waiting for network events
. 2010-03-03 19:26:25.200 Waiting for another 4 bytes
. 2010-03-03 19:26:25.200 Looking for incoming data
. 2010-03-03 19:26:25.200 Looking for network events

After these lines, the logs seem to be in sync again.

I have seen similar failures reported for SFTP fetches even though the operation has been successful. I have not investigated these in detail though.

Can you advise on this at all? I would like to upgrade to 4.2.5 but cannot if the application reports false errors.


OS Windows Server 2003
Current version of winscp = 4.0.6
Methodology: Scripting/automation
SFTP site: Titan run site supporting SFTP, FTP and FTPS.

Session protocol = SSH-2
SSH implementation = 1.82 sshlib: sshlibSrSshServer 1.00
Encryption algorithm = aes
Compression = No
File transfer protocol = SFTP-3
Server host key fingerprint
ssh-rsa *****************************************************************
Can change permissions = Yes
Can change owner/group = Yes
Can execute arbitrary command = No
Can create symlink/hardlink = Yes/No
Can lookup user groups = No
Can duplicate remote files = No
Can check available space = No
Can calculate file checksum = No
Native text (ASCII) mode transfers = No
Additional information
The server does not support any SFTP extension.