Invalid access to memory
Hello
I have encountered an 'Invalid access to memory' error when running the sftp session.
The error is displayed on 'exit' command - see last line of the script below.
The problem is that script exists with code 12 so when I automate it, it is reported as a failure. When I check the results, all seems to be fine.
The environment is as follows:
windows 2008 64 bit
winscp 4.2.8 build 818
the executed batch file:
the winscp_script.txt file:
The log file:
I have encountered an 'Invalid access to memory' error when running the sftp session.
The error is displayed on 'exit' command - see last line of the script below.
The problem is that script exists with code 12 so when I automate it, it is reported as a failure. When I check the results, all seems to be fine.
The environment is as follows:
windows 2008 64 bit
winscp 4.2.8 build 818
the executed batch file:
SETLOCAL EnableDelayedExpansion pushd E:\BIASDW_ETL\config\brel_sftp winscp.com /console /script=winscp_script.txt /log=sftp.log /parameter %date:-=%
the winscp_script.txt file:
option batch on option confirm off open sftp://xxxQ@xxx.xxx.xxx.xxx:22 -privatekey=PRIVATE.ppk -hostkey="ssh-dss 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" cd /Usr/xxx/IN lcd \\host01\download get file1_%1%.csv file1.csv get file2_%1%.csv file2.csv get file3_%1%.csv file3.csv get file4_%1%.csv file4.csv close exit
The log file:
. 2010-07-21 15:03:24.358 -------------------------------------------------------------------------- . 2010-07-21 15:03:24.358 WinSCP Version 4.2.8 (Build 818) (OS 6.0.6002 Service Pack 2) . 2010-07-21 15:03:24.358 Login time: 21 lipiec 2010 15:03:24 . 2010-07-21 15:03:24.358 -------------------------------------------------------------------------- . 2010-07-21 15:03:24.359 Session name: xxxxxxxxxxx . 2010-07-21 15:03:24.359 Host name: xxxxxxxxxx (Port: 22) . 2010-07-21 15:03:24.359 User name: xxxxxxxxxx (Password: No, Key file: Yes) . 2010-07-21 15:03:24.359 Tunnel: No . 2010-07-21 15:03:24.359 Transfer Protocol: SFTP . 2010-07-21 15:03:24.359 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec . 2010-07-21 15:03:24.359 Proxy: none . 2010-07-21 15:03:24.359 SSH protocol version: 2; Compression: No . 2010-07-21 15:03:24.359 Bypass authentication: No . 2010-07-21 15:03:24.359 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No . 2010-07-21 15:03:24.359 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No . 2010-07-21 15:03:24.359 SSH Bugs: -,-,-,-,-,-,-,-,- . 2010-07-21 15:03:24.359 SFTP Bugs: -,- . 2010-07-21 15:03:24.359 Return code variable: Autodetect; Lookup user groups: Yes . 2010-07-21 15:03:24.359 Shell: default . 2010-07-21 15:03:24.359 EOL: 0, UTF: 2 . 2010-07-21 15:03:24.359 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes . 2010-07-21 15:03:24.359 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No . 2010-07-21 15:03:24.359 Local directory: default, Remote directory: home, Update: No, Cache: Yes . 2010-07-21 15:03:24.359 Cache directory changes: Yes, Permanent: Yes . 2010-07-21 15:03:24.359 DST mode: 1 . 2010-07-21 15:03:24.359 -------------------------------------------------------------------------- . 2010-07-21 15:03:24.359 Looking up host "xxxxxxxxxx" . 2010-07-21 15:03:24.359 Connecting to xxxxxxxxxx port 22 . 2010-07-21 15:03:24.363 Server version: SSH-2.0-1.36_sshlib GlobalSCAPE . 2010-07-21 15:03:24.363 We believe remote version ignores SSH-2 maximum packet size . 2010-07-21 15:03:24.363 We believe remote version has SSH-2 ignore bug . 2010-07-21 15:03:24.363 Using SSH protocol version 2 . 2010-07-21 15:03:24.363 We claim version: SSH-2.0-WinSCP_release_4.2.8 . 2010-07-21 15:03:24.364 Doing Diffie-Hellman group exchange . 2010-07-21 15:03:24.548 Doing Diffie-Hellman key exchange with hash SHA-1 . 2010-07-21 15:03:24.732 Host key fingerprint is: . 2010-07-21 15:03:24.732 ssh-dss 1024 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx . 2010-07-21 15:03:24.732 Initialised AES-256 CBC client->server encryption . 2010-07-21 15:03:24.732 Initialised HMAC-SHA1 client->server MAC algorithm . 2010-07-21 15:03:24.732 Initialised AES-256 CBC server->client encryption . 2010-07-21 15:03:24.732 Initialised HMAC-SHA1 server->client MAC algorithm . 2010-07-21 15:03:24.861 Reading private key file "PRIVATE.ppk" ! 2010-07-21 15:03:24.861 Using username "xxx". ! 2010-07-21 15:03:24.862 Further authentication required . 2010-07-21 15:03:24.862 Further authentication required . 2010-07-21 15:03:24.863 Offered public key . 2010-07-21 15:03:24.864 Offer of public key accepted ! 2010-07-21 15:03:24.864 Authenticating with public key "rsa-key-20100714" . 2010-07-21 15:03:24.926 Access granted . 2010-07-21 15:03:24.927 Opened channel for session . 2010-07-21 15:03:24.970 Started a shell/command . 2010-07-21 15:03:24.970 -------------------------------------------------------------------------- . 2010-07-21 15:03:24.970 Using SFTP protocol. . 2010-07-21 15:03:24.970 Doing startup conversation with host. > 2010-07-21 15:03:24.971 Type: SSH_FXP_INIT, Size: 5, Number: -1 < 2010-07-21 15:03:24.972 Type: SSH_FXP_VERSION, Size: 5, Number: -1 . 2010-07-21 15:03:24.972 SFTP version 3 negotiated. . 2010-07-21 15:03:24.972 We believe the server has signed timestamps bug . 2010-07-21 15:03:24.972 We will use UTF-8 strings for status messages only . 2010-07-21 15:03:24.972 Getting current directory name. . 2010-07-21 15:03:24.972 Getting real path for '.' > 2010-07-21 15:03:24.972 Type: SSH_FXP_REALPATH, Size: 10, Number: 16 < 2010-07-21 15:03:24.973 Type: SSH_FXP_NAME, Size: 47, Number: 16 . 2010-07-21 15:03:24.973 Real path is '/Usr/xxxxxx' . 2010-07-21 15:03:24.973 Startup conversation with host finished. < 2010-07-21 15:03:24.973 Script: Active session: [1] xxx@xxxxxxxxxxxxxxx > 2010-07-21 15:03:24.973 Script: cd /Usr/xxx/IN . 2010-07-21 15:03:24.974 Cached directory change via "/Usr/xxxx/IN" to "/Usr/xxxxxx/IN". . 2010-07-21 15:03:24.974 Getting current directory name. < 2010-07-21 15:03:24.974 Script: /Usr/xxx/IN > 2010-07-21 15:03:24.974 Script: lcd \\host01\download < 2010-07-21 15:03:25.031 Script: \\host01\download > 2010-07-21 15:03:25.031 Script: get file1_20100721.csv file1.csv . 2010-07-21 15:03:25.031 Listing file "file1_20100721.csv". > 2010-07-21 15:03:25.031 Type: SSH_FXP_LSTAT, Size: 56, Number: 263 < 2010-07-21 15:03:25.033 Type: SSH_FXP_ATTRS, Size: 29, Number: 263 . 2010-07-21 15:03:25.033 File: "/Usr/xxx/IN/file2_20100721.csv" . 2010-07-21 15:03:25.034 Copying "/Usr/xxx/IN/file2_20100721.csv" to local directory started. . 2010-07-21 15:03:25.034 Binary transfer mode selected. . 2010-07-21 15:03:25.035 Checking existence of partially transfered file. . 2010-07-21 15:03:25.051 Confirming overwriting of file. . 2010-07-21 15:03:25.054 Opening remote file. > 2010-07-21 15:03:25.054 Type: SSH_FXP_OPEN, Size: 64, Number: 515 < 2010-07-21 15:03:25.056 Type: SSH_FXP_HANDLE, Size: 10, Number: 515 > 2010-07-21 15:03:25.056 Type: SSH_FXP_FSTAT, Size: 10, Number: 776 > 2010-07-21 15:03:25.056 Type: SSH_FXP_READ, Size: 22, Number: 1029 . 2010-07-21 15:03:25.058 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. < 2010-07-21 15:03:25.058 Type: SSH_FXP_ATTRS, Size: 29, Number: 776 . 2010-07-21 15:03:25.058 Storing reserved response < 2010-07-21 15:03:25.554 Status code: 1 . 2010-07-21 15:03:25.554 137 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. > 2010-07-21 15:03:25.554 Type: SSH_FXP_CLOSE, Size: 10, Number: 19460 < 2010-07-21 15:03:25.554 Type: SSH_FXP_STATUS, Size: 22, Number: 18693 < 2010-07-21 15:03:25.556 Type: SSH_FXP_STATUS, Size: 22, Number: 18949 < 2010-07-21 15:03:25.558 Type: SSH_FXP_STATUS, Size: 22, Number: 19205 > 2010-07-21 15:03:25.600 Script: get file2_20100721.csv file2.csv . 2010-07-21 15:03:25.600 Listing file "file2_20100721.csv". > 2010-07-21 15:03:25.600 Type: SSH_FXP_LSTAT, Size: 56, Number: 19719 < 2010-07-21 15:03:25.600 Type: SSH_FXP_STATUS, Size: 21, Number: 19460 . 2010-07-21 15:03:25.600 Discarding reserved response < 2010-07-21 15:03:25.601 Type: SSH_FXP_ATTRS, Size: 29, Number: 19719 . 2010-07-21 15:03:25.602 File: "/Usr/xxx/IN/file2_20100721.csv" . 2010-07-21 15:03:25.602 Copying "/Usr/xxx/IN/file2_20100721.csv" to local directory started. . 2010-07-21 15:03:25.602 Binary transfer mode selected. . 2010-07-21 15:03:25.604 Checking existence of partially transfered file. . 2010-07-21 15:03:25.619 Confirming overwriting of file. . 2010-07-21 15:03:25.622 Opening remote file. > 2010-07-21 15:03:25.622 Type: SSH_FXP_OPEN, Size: 64, Number: 19971 < 2010-07-21 15:03:25.625 Type: SSH_FXP_HANDLE, Size: 10, Number: 19971 > 2010-07-21 15:03:25.625 Type: SSH_FXP_FSTAT, Size: 10, Number: 20232 > 2010-07-21 15:03:25.625 Type: SSH_FXP_READ, Size: 22, Number: 20485 . 2010-07-21 15:03:25.629 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. < 2010-07-21 15:03:25.629 Type: SSH_FXP_ATTRS, Size: 29, Number: 20232 . 2010-07-21 15:03:25.629 Storing reserved response < 2010-07-21 15:03:25.672 Status code: 1 . 2010-07-21 15:03:25.672 23 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. > 2010-07-21 15:03:25.672 Type: SSH_FXP_CLOSE, Size: 10, Number: 24324 < 2010-07-21 15:03:25.672 Type: SSH_FXP_STATUS, Size: 22, Number: 23557 < 2010-07-21 15:03:25.672 Type: SSH_FXP_STATUS, Size: 22, Number: 23813 < 2010-07-21 15:03:25.674 Type: SSH_FXP_STATUS, Size: 22, Number: 24069 > 2010-07-21 15:03:25.713 Script: get file3_20100721.csv file3.csv . 2010-07-21 15:03:25.713 Listing file "file3_20100721.csv". > 2010-07-21 15:03:25.713 Type: SSH_FXP_LSTAT, Size: 54, Number: 24583 < 2010-07-21 15:03:25.713 Type: SSH_FXP_STATUS, Size: 21, Number: 24324 . 2010-07-21 15:03:25.713 Discarding reserved response < 2010-07-21 15:03:25.715 Type: SSH_FXP_ATTRS, Size: 29, Number: 24583 . 2010-07-21 15:03:25.715 File: "/Usr/xxx/IN/file3_20100721.csv" . 2010-07-21 15:03:25.715 Copying "/Usr/xxx/IN/file3_20100721.csv" to local directory started. . 2010-07-21 15:03:25.716 Binary transfer mode selected. . 2010-07-21 15:03:25.718 Checking existence of partially transfered file. . 2010-07-21 15:03:25.735 Confirming overwriting of file. . 2010-07-21 15:03:25.737 Opening remote file. > 2010-07-21 15:03:25.737 Type: SSH_FXP_OPEN, Size: 62, Number: 24835 < 2010-07-21 15:03:25.738 Type: SSH_FXP_HANDLE, Size: 10, Number: 24835 > 2010-07-21 15:03:25.738 Type: SSH_FXP_FSTAT, Size: 10, Number: 25096 > 2010-07-21 15:03:25.738 Type: SSH_FXP_READ, Size: 22, Number: 25349 . 2010-07-21 15:03:25.739 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. < 2010-07-21 15:03:25.739 Type: SSH_FXP_ATTRS, Size: 29, Number: 25096 . 2010-07-21 15:03:25.739 Storing reserved response < 2010-07-21 15:03:25.985 Status code: 1 . 2010-07-21 15:03:25.985 73 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. > 2010-07-21 15:03:25.985 Type: SSH_FXP_CLOSE, Size: 10, Number: 35588 < 2010-07-21 15:03:25.985 Type: SSH_FXP_STATUS, Size: 22, Number: 34821 < 2010-07-21 15:03:25.988 Type: SSH_FXP_STATUS, Size: 22, Number: 35077 < 2010-07-21 15:03:25.990 Type: SSH_FXP_STATUS, Size: 22, Number: 35333 > 2010-07-21 15:03:26.030 Script: get file4_20100721.csv file4.csv . 2010-07-21 15:03:26.030 Listing file "file4_20100721.csv". > 2010-07-21 15:03:26.030 Type: SSH_FXP_LSTAT, Size: 49, Number: 35847 < 2010-07-21 15:03:26.030 Type: SSH_FXP_STATUS, Size: 21, Number: 35588 . 2010-07-21 15:03:26.030 Discarding reserved response < 2010-07-21 15:03:26.032 Type: SSH_FXP_ATTRS, Size: 29, Number: 35847 . 2010-07-21 15:03:26.032 File: "/Usr/xxx/IN/file4_20100721.csv" . 2010-07-21 15:03:26.032 Copying "/Usr/xxx/IN/file4_20100721.csv" to local directory started. . 2010-07-21 15:03:26.032 Binary transfer mode selected. . 2010-07-21 15:03:26.035 Checking existence of partially transfered file. . 2010-07-21 15:03:26.051 Confirming overwriting of file. . 2010-07-21 15:03:26.205 Opening remote file. > 2010-07-21 15:03:26.205 Type: SSH_FXP_OPEN, Size: 57, Number: 36099 < 2010-07-21 15:03:26.206 Type: SSH_FXP_HANDLE, Size: 10, Number: 36099 > 2010-07-21 15:03:26.206 Type: SSH_FXP_FSTAT, Size: 10, Number: 36360 > 2010-07-21 15:03:26.206 Type: SSH_FXP_READ, Size: 22, Number: 36613 . 2010-07-21 15:03:26.207 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. < 2010-07-21 15:03:26.207 Type: SSH_FXP_ATTRS, Size: 29, Number: 36360 . 2010-07-21 15:03:26.207 Storing reserved response < 2010-07-21 15:03:26.487 Status code: 1 . 2010-07-21 15:03:26.487 79 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. > 2010-07-21 15:03:26.487 Type: SSH_FXP_CLOSE, Size: 10, Number: 47620 < 2010-07-21 15:03:26.487 Type: SSH_FXP_STATUS, Size: 22, Number: 46853 < 2010-07-21 15:03:26.487 Type: SSH_FXP_STATUS, Size: 22, Number: 47109 < 2010-07-21 15:03:26.491 Type: SSH_FXP_STATUS, Size: 22, Number: 47365 > 2010-07-21 15:03:26.528 Script: close . 2010-07-21 15:03:26.528 Closing connection. . 2010-07-21 15:03:26.528 Sending special code: 12 . 2010-07-21 15:03:26.528 Sent EOF message