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.

Options
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)

Options

Topic review

martin

Re: Errorlevel=1 even though file was transferred successfully

There's no "prompt off" command in WinSCP.
mfaarup

Errorlevel=1 even though file was transferred successfully

Logfile states several errorcodes, but the last few ones are 0.
All I get from errorlevel is 1??
I am expecting some way of knowing that it completed successfully.

I believe I have tried all combination of Option batch on|abort|continue and all checks of errorlevel 0|1 etc.

Any help greatly appreciated! only option I have left is to text-search through the logfile, which I find silly.

Below is bat-script, ftp-script and logfile-piece

.bat file script:
winscp415.exe /log=logs\ftplog.log /script=transfer.ftp
if errorlevel 1 goto FTPError1

echo Success ftp 1
goto FTPend

:FTPError1
start /w %workdir%Pay_FTP_alert_bad.bat
%workdir%sleep 10
echo Error 1
goto FTPend

:FTPend
Other stuff

FTP Script:
prompt off
option confirm off
option batch abort
open xxxxx:password@server1
cd /server1/transfer/files
option transfer binary
put *.xml
close
exit

Logfile (last part):
Checking existence of file.
Type: SSH_FXP_LSTAT, Size: 90, Number: 64519
Type: SSH_FXP_STATUS, Size: 29, Number: 64519
Status/error code: 2
Checking existence of partially transfered file.
Type: SSH_FXP_LSTAT, Size: 99, Number: 64775
Type: SSH_FXP_STATUS, Size: 29, Number: 64775
Status/error code: 2
Opening remote file.
Type: SSH_FXP_OPEN, Size: 115, Number: 65027
Type: SSH_FXP_HANDLE, Size: 13, Number: 65027
Type: SSH_FXP_WRITE, Size: 32764, Number: 65542
468 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 125956
Type: SSH_FXP_STATUS, Size: 24, Number: 125190
Type: SSH_FXP_STATUS, Size: 24, Number: 125446
Type: SSH_FXP_STATUS, Size: 24, Number: 125702
Type: SSH_FXP_STATUS, Size: 24, Number: 125956
Status/error code: 0
Type: SSH_FXP_RENAME, Size: 184, Number: 126226
Type: SSH_FXP_STATUS, Size: 24, Number: 126226
Status/error code: 0
Type: SSH_FXP_SETSTAT, Size: 102, Number: 65289
Type: SSH_FXP_STATUS, Size: 24, Number: 65289
Status/error code: 0
Closing connection.
Sending special code: 12
Sent EOF message
martin

Re: Successful Put transfer but errorcode 1 in WinScp V 416

It seems that you batch file is not correct.
There's no code that would jump to noerr, in case script succeeds.
chris

Successful Put transfer but errorcode 1 in WinScp V 416

Hello!

First of all, thank you very much for this great tool that really does a great job!
STill I do have problem with a script which always returns errorlevel 1 although I can verify the put transfer has been completed successfull. Furthermore I can not see any problem within the output of winscp nor in the log file.

Any help is highly appreciated...

Thank youe very much!

Chris

Here is the Batch file (Win XP, SP2) that calls WinSCP.com (V416, Build 412):

If exist active_put.txt goto end
subst r: d:\xyz_Transfer

:start

START /W .\DTHRMNSS.EXE
CALL .\DTHRMNSS.BAT


copy put.ftp active_put.txt

echo ------------- >> Put_FTP.LOG
echo %DTHRMNSS% >> Put_FTP.LOG
echo ------------- >> Put_FTP.LOG

winscp.com /log=.\winscp.log /script=r:\Quality\put.ftp >> Put_FTP.LOG
if errorlevel 1 goto ERROR

:error

echo ******** error **** >> Put_FTP.LOG
del active_put.txt
goto end

:noerr

move /Y r:\Quality\_xyz_Data_\Out\*.* r:\Quality\_xyz_Data_\_Old\Out\
del active_put.txt
net use R: /delete

:end


The script put.ftp:

open -timeout=30 sftp://removed:password@10.0.0.1
cd Data
option transfer binary
option batch on
option confirm off
put -nopermissions r:\Quality\_xyz_Data_\Out\*.*
close
exit

Here is the output of the Winscp script:

-------------
29082008075213
-------------
Searching for host...
Connecting to host...
Authenticating...
Using username "removed".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] removed@10.0.0.1
/daten/company/Data
transfer binary
batch on
confirm off
r:\Quality\_xyz_Data_\Out\Del_FTP.L | 0 KiB | 0,0 KiB/s | binary | 100%
Session 'removed@10.0.0.1' closed.
No session.

And finally the WinSCP Log:

. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 WinSCP Version 4.1.6 (Build 412) (OS 5.1.2600 Service Pack 2)
. 2008-08-29 07:52:14.515 Login time: Freitag, 29. August 2008 07:52:14
. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 Session name: removed@10.0.0.1
. 2008-08-29 07:52:14.515 Host name: 10.0.0.1 (Port: 22)
. 2008-08-29 07:52:14.515 User name: removed (Password: Yes, Key file: No)
. 2008-08-29 07:52:14.515 Tunnel: No
. 2008-08-29 07:52:14.515 Transfer Protocol: SFTP
. 2008-08-29 07:52:14.515 Ping type: -, Ping interval: 30 sec; Timeout: 30 sec
. 2008-08-29 07:52:14.515 Proxy: none
. 2008-08-29 07:52:14.515 SSH protocol version: 2; Compression: No
. 2008-08-29 07:52:14.515 Bypass authentication: No
. 2008-08-29 07:52:14.515 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2008-08-29 07:52:14.515 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2008-08-29 07:52:14.515 SSH Bugs: -,-,-,-,-,-,-,-
. 2008-08-29 07:52:14.515 SFTP Bugs: -,-
. 2008-08-29 07:52:14.515 Return code variable: Autodetect; Lookup user groups: Yes
. 2008-08-29 07:52:14.515 Shell: default, EOL: 0
. 2008-08-29 07:52:14.515 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2008-08-29 07:52:14.515 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2008-08-29 07:52:14.515 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2008-08-29 07:52:14.515 Cache directory changes: Yes, Permanent: Yes
. 2008-08-29 07:52:14.515 DST mode: 1
. 2008-08-29 07:52:14.515 --------------------------------------------------------------------------
. 2008-08-29 07:52:14.515 Looking up host "10.0.0.1"
. 2008-08-29 07:52:14.515 Connecting to 10.0.0.1 port 22
. 2008-08-29 07:52:14.578 Server version: SSH-2.0-OpenSSH_4.5
. 2008-08-29 07:52:14.578 We claim version: SSH-2.0-WinSCP_release_4.1.6
. 2008-08-29 07:52:14.578 SSPI: acquired credentials for: username@Domain
. 2008-08-29 07:52:14.578 Cannot convert IP address to SPN: DNS is not trusted
. 2008-08-29 07:52:14.578 GSSKEX disabled: Der Vorgang wurde erfolgreich beendet.. 2008-08-29 07:52:14.578 Using SSH protocol version 2
. 2008-08-29 07:52:14.609 Doing Diffie-Hellman group exchange
. 2008-08-29 07:52:14.718 Doing Diffie-Hellman key exchange with hash SHA-1
. 2008-08-29 07:52:15.062 Host key fingerprint is:
. 2008-08-29 07:52:15.062 ssh-rsa 2048 02:57:f9:53:6d:8a:cc:f7:5f:02:57:f9:53:6d:8a
. 2008-08-29 07:52:15.062 Initialised AES-256 SDCTR client->server encryption
. 2008-08-29 07:52:15.062 Initialised HMAC-SHA1 client->server MAC algorithm
. 2008-08-29 07:52:15.062 Initialised AES-256 SDCTR server->client encryption
. 2008-08-29 07:52:15.062 Initialised HMAC-SHA1 server->client MAC algorithm
! 2008-08-29 07:52:15.156 Using username "removed".
. 2008-08-29 07:52:35.218 Prompt (6, SSH password, , &Password: )
. 2008-08-29 07:52:35.218 Using stored password.
. 2008-08-29 07:52:35.218 Sent password
. 2008-08-29 07:52:35.250 Access granted
. 2008-08-29 07:52:35.296 Opened channel for session
. 2008-08-29 07:52:35.359 Started a shell/command
. 2008-08-29 07:52:35.359 --------------------------------------------------------------------------
. 2008-08-29 07:52:35.359 Using SFTP protocol.
. 2008-08-29 07:52:35.359 Doing startup conversation with host.
> 2008-08-29 07:52:35.375 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2008-08-29 07:52:35.406 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2008-08-29 07:52:35.406 SFTP version 3 negotiated.
. 2008-08-29 07:52:35.406 We believe the server has signed timestamps bug
. 2008-08-29 07:52:35.406 We will use UTF-8 strings for status messages only
. 2008-08-29 07:52:35.406 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2008-08-29 07:52:35.406 Getting current directory name.
. 2008-08-29 07:52:35.406 Getting real path for '.'
> 2008-08-29 07:52:35.406 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2008-08-29 07:52:35.437 Type: SSH_FXP_NAME, Size: 47, Number: 16
. 2008-08-29 07:52:35.437 Real path is '/daten/company'
. 2008-08-29 07:52:35.437 Startup conversation with host finished.
. 2008-08-29 07:52:35.437 Cached directory change via "removed" to "/daten/company/Data".
. 2008-08-29 07:52:35.437 Getting current directory name.
. 2008-08-29 07:52:35.437 Copying 1 files/directories to remote directory "/daten/company/Data"
. 2008-08-29 07:52:35.437 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 01; Resume: S (102400); CalcS: No; Mask:
. 2008-08-29 07:52:35.437 TM: B; ClAr: No; CPS: 0; ExclM(No):
. 2008-08-29 07:52:35.437 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2008-08-29 07:52:35.453 File: "r:\Quality\_xyz_Data_\Out\Del_FTP.L"
. 2008-08-29 07:52:35.468 Copying "r:\Quality\_xyz_Data_\Out\Del_FTP.L" to remote directory started.
. 2008-08-29 07:52:35.468 Binary transfer mode selected.
. 2008-08-29 07:52:35.468 Opening remote file.
> 2008-08-29 07:52:35.468 Type: SSH_FXP_OPEN, Size: 55, Number: 259
< 2008-08-29 07:52:35.484 Type: SSH_FXP_HANDLE, Size: 13, Number: 259
> 2008-08-29 07:52:35.484 Type: SSH_FXP_WRITE, Size: 387, Number: 774
> 2008-08-29 07:52:35.484 Type: SSH_FXP_CLOSE, Size: 13, Number: 1028
> 2008-08-29 07:52:35.484 Type: SSH_FXP_SETSTAT, Size: 51, Number: 521
< 2008-08-29 07:52:35.515 Type: SSH_FXP_STATUS, Size: 24, Number: 774
< 2008-08-29 07:52:35.546 Type: SSH_FXP_STATUS, Size: 24, Number: 1028
< 2008-08-29 07:52:35.546 Status/error code: 0
< 2008-08-29 07:52:35.546 Type: SSH_FXP_STATUS, Size: 24, Number: 521
< 2008-08-29 07:52:35.546 Status/error code: 0
. 2008-08-29 07:52:35.546 Closing connection.
. 2008-08-29 07:52:35.546 Sending special code: 12
. 2008-08-29 07:52:35.546 Sent EOF message