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

markoman8

Success!

Note that the correct parameter/argument to the winscp.exe is /ini=nul not with double ll (null) as mentioned before.
markoman8

Found a relevant topic: https://winscp.net/forum/viewtopic.php?t=23957

I suppose that I have to add back the /ini=null in the line while revoking the winscp.exe

I'll give it a try and let this forum know
markoman8

Error message from server: No such file WinSCP v. 5.19.3 (Build 11749)

Hello all,

I have a problem retrieving certain files via get command (4 of them) from a server. The files do exist in the /Reports directory of the server but as seen from the log file I cannot retrieve nor just the first of them. Those commands run from a batch file/script via Task Scheduler. Running the same script from command prompt, does the job nicely and those files along with the other commands complete successfully. Any thoughts?
 2021-10-20 07:58:03.173 --------------------------------------------------------------------------
. 2021-10-20 07:58:03.173 WinSCP Version 5.19.3 (Build 11749) (OS 10.0.18362 - Windows 10 Enterprise)
. 2021-10-20 07:58:03.174 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2021-10-20 07:58:03.174 Log level: Normal
. 2021-10-20 07:58:03.174 Local account: TMNA\theuser
. 2021-10-20 07:58:03.174 Working directory: C:\WINDOWS\system32
. 2021-10-20 07:58:03.174 Process ID: 13652
. 2021-10-20 07:58:03.196 Ancestor processes: WinSCP, cmd, ...
. 2021-10-20 07:58:03.196 Command-line: "C:\Users\theuser\AppData\Local\Programs\WinSCP\WinSCP.exe" /console=5.19.3 /consoleinstance=_21876_872 "/script=D:\theuser\Transmission\Reports\ScriptLogs\PoTP\myscript_PoTP.txt" "/log=D:\theuser\Transmission\Reports\ScriptLogs\PoTP\logWinSCP_20211020.log" "/loglevel=0"
. 2021-10-20 07:58:03.201 Time zone: Current: GMT+3, Standard: GMT+2 (GTB Standard Time), DST: GMT+3 (GTB Daylight Time), DST Start: 28/3/2021, DST End: 31/10/2021
. 2021-10-20 07:58:03.202 Login time: Τετάρτη, 20 Οκτώβριος 2021 7:58:03 πμ
. 2021-10-20 07:58:03.202 --------------------------------------------------------------------------
. 2021-10-20 07:58:03.202 Script: Retrospectively logging previous script records:
> 2021-10-20 07:58:03.202 Script: open sftp://theuser:***@<theIP>/ -hostkey="ssh-ed25519 255 ******************"
. 2021-10-20 07:58:03.202 --------------------------------------------------------------------------
. 2021-10-20 07:58:03.202 Session name: theuser@<theIP> (Ad-Hoc site)
. 2021-10-20 07:58:03.202 Host name: <theIP> (Port: 22)
. 2021-10-20 07:58:03.202 User name: theuser (Password: Yes, Key file: No, Passphrase: No)
. 2021-10-20 07:58:03.202 Tunnel: No
. 2021-10-20 07:58:03.202 Transfer Protocol: SFTP
. 2021-10-20 07:58:03.202 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2021-10-20 07:58:03.202 Disable Nagle: No
. 2021-10-20 07:58:03.202 Proxy: None
. 2021-10-20 07:58:03.202 Send buffer: 262144
. 2021-10-20 07:58:03.202 SSH protocol version: 2; Compression: No
. 2021-10-20 07:58:03.202 Bypass authentication: No
. 2021-10-20 07:58:03.202 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2021-10-20 07:58:03.202 GSSAPI: KEX: No; Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2021-10-20 07:58:03.202 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2021-10-20 07:58:03.202 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2021-10-20 07:58:03.202 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2021-10-20 07:58:03.202 Simple channel: Yes
. 2021-10-20 07:58:03.202 Return code variable: Autodetect; Lookup user groups: Auto
. 2021-10-20 07:58:03.202 Shell: default
. 2021-10-20 07:58:03.202 EOL: LF, UTF: Auto
. 2021-10-20 07:58:03.202 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2021-10-20 07:58:03.202 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2021-10-20 07:58:03.202 SFTP Bugs: Auto,Auto
. 2021-10-20 07:58:03.202 SFTP Server: default
. 2021-10-20 07:58:03.202 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2021-10-20 07:58:03.202 Cache directory changes: Yes, Permanent: Yes
. 2021-10-20 07:58:03.202 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2021-10-20 07:58:03.202 DST mode: Unix
. 2021-10-20 07:58:03.202 --------------------------------------------------------------------------
< 2021-10-20 07:58:03.202 Script: Searching for host...
. 2021-10-20 07:58:03.203 Looking up host "<theIP>" for SSH connection
. 2021-10-20 07:58:03.203 Connecting to <theIP> port 22
< 2021-10-20 07:58:03.216 Script: Connecting to host...
. 2021-10-20 07:58:03.216 We claim version: SSH-2.0-WinSCP_release_5.19.3
. 2021-10-20 07:58:03.253 Remote version: SSH-2.0-OpenSSH_8.2
. 2021-10-20 07:58:03.253 Using SSH protocol version 2
. 2021-10-20 07:58:03.254 Have a known host key of type ssh-ed25519
. 2021-10-20 07:58:03.267 Doing ECDH key exchange with curve nistp256 and hash SHA-256
. 2021-10-20 07:58:03.356 Server also has ecdsa-sha2-nistp256/ssh-rsa host keys, but we don't know any of them
. 2021-10-20 07:58:03.357 Host key fingerprint is:
. 2021-10-20 07:58:03.357 ssh-ed25519 255 **************
< 2021-10-20 07:58:03.357 Script: Authenticating...
. 2021-10-20 07:58:03.357 Host key matches cached key
. 2021-10-20 07:58:03.358 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] outbound encryption
. 2021-10-20 07:58:03.358 Initialised HMAC-SHA-256 outbound MAC algorithm
. 2021-10-20 07:58:03.358 Initialised AES-256 SDCTR (AES-NI accelerated) [aes256-ctr] inbound encryption
. 2021-10-20 07:58:03.359 Initialised HMAC-SHA-256 inbound MAC algorithm
! 2021-10-20 07:58:03.369 Using username "theuser".
< 2021-10-20 07:58:03.369 Script: Using username "theuser".
! 2021-10-20 07:58:03.417 Authorized users only. All activities may be monitored and reported.
. 2021-10-20 07:58:03.417 Server offered these authentication methods: publickey,password
. 2021-10-20 07:58:03.417 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2021-10-20 07:58:03.417 Using stored password.
< 2021-10-20 07:58:03.417 Script: Authenticating with pre-entered password.
. 2021-10-20 07:58:03.417 Sent password
. 2021-10-20 07:58:03.444 Access granted
. 2021-10-20 07:58:03.445 Opening main session channel
. 2021-10-20 07:58:03.457 Opened main channel
. 2021-10-20 07:58:03.472 Started a shell/command
< 2021-10-20 07:58:03.472 Script: Authenticated.
. 2021-10-20 07:58:03.473 --------------------------------------------------------------------------
. 2021-10-20 07:58:03.473 Using SFTP protocol.
. 2021-10-20 07:58:03.474 Doing startup conversation with host.
< 2021-10-20 07:58:03.474 Script: Starting the session...
> 2021-10-20 07:58:03.475 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2021-10-20 07:58:03.486 Type: SSH_FXP_VERSION, Size: 179, Number: -1
. 2021-10-20 07:58:03.486 SFTP version 3 negotiated.
. 2021-10-20 07:58:03.486 Unknown server extension posix-rename@openssh.com="1"
. 2021-10-20 07:58:03.486 Supports statvfs@openssh.com extension version "2"
. 2021-10-20 07:58:03.486 Unknown server extension fstatvfs@openssh.com="2"
. 2021-10-20 07:58:03.486 Supports hardlink@openssh.com extension version "1"
. 2021-10-20 07:58:03.486 Unknown server extension fsync@openssh.com="1"
. 2021-10-20 07:58:03.486 Unknown server extension lsetstat@openssh.com="1"
. 2021-10-20 07:58:03.487 We believe the server has signed timestamps bug
. 2021-10-20 07:58:03.487 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2021-10-20 07:58:03.487 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2021-10-20 07:58:03.487 Getting current directory name.
. 2021-10-20 07:58:03.487 Getting real path for '.'
> 2021-10-20 07:58:03.487 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2021-10-20 07:58:03.497 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2021-10-20 07:58:03.498 Real path is '/'
. 2021-10-20 07:58:03.498 Startup conversation with host finished.
< 2021-10-20 07:58:03.498 Script: Session started.
< 2021-10-20 07:58:03.498 Script: Active session: [1] theuser@<theIP>
> 2021-10-20 07:58:03.500 Script: lcd D:\theuser\Transmission\Reports\PoTP_SFP
< 2021-10-20 07:58:03.500 Script: D:\theuser\Transmission\Reports\PoTP_SFP
> 2021-10-20 07:58:03.502 Script: cd Reports
. 2021-10-20 07:58:03.502 Cached directory change via "Reports" to "/Reports".
. 2021-10-20 07:58:03.502 Getting current directory name.
< 2021-10-20 07:58:03.502 Script: /Reports
> 2021-10-20 07:58:03.503 Script: get "PM_IG500011_15_202110200000Z_01.csv.gz"
. 2021-10-20 07:58:03.504 Listing file "PM_IG500011_15_202110200000Z_01.csv.gz".
> 2021-10-20 07:58:03.504 Type: SSH_FXP_LSTAT, Size: 56, Number: 263
< 2021-10-20 07:58:03.516 Type: SSH_FXP_STATUS, Size: 29, Number: 263
< 2021-10-20 07:58:03.516 Status code: 2, Message: 263, Server: No such file, Language: 
< 2021-10-20 07:58:03.517 Script: Can't get attributes of file 'PM_IG500011_15_202110200000Z_01.csv.gz'.
< 2021-10-20 07:58:03.517 No such file or directory.
< 2021-10-20 07:58:03.517 Error code: 2
< 2021-10-20 07:58:03.517 Error message from server: No such file
. 2021-10-20 07:58:03.518 Script: Failed
. 2021-10-20 07:58:03.518 Script: Exit code: 1
. 2021-10-20 07:58:03.518 Closing connection.
. 2021-10-20 07:58:03.518 Sending special code: 1
. 2021-10-20 07:58:03.535 Session sent command exit status 0
. 2021-10-20 07:58:03.535 Main session channel closed
. 2021-10-20 07:58:03.536 All channels closed

And just bellow is the same script as run via cmd.
C:\Users\theuser\AppData\Local\Programs\WinSCP>cronedWinSCP_PoTP.bat

20211020
2021 10 20
Searching for host...
Connecting to host...
Authenticating...
Using username "theuser".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] theuser@<theIP>
D:\theuser\Transmission\Reports\PoTP_SFP
/Reports
PM_IG500011_15_2021102000 |          40 KB |  189,2 KB/s | binary | 100%
PM_IG500012_15_2021102000 |          36 KB |  161,1 KB/s | binary | 100%
PM_IG500011_1440_20211018 |           6 KB |    0,0 KB/s | binary | 100%
PM_IG500012_1440_20211018 |           5 KB |    0,0 KB/s | binary | 100%
The most recently created file is PM_IG500012_1440_202110182100Z_01.csv

C:\Users\theuser\AppData\Local\Programs\WinSCP>