WinSCP command failed to run the FTP upload operation

Advertisement

shirish
Guest

WinSCP command failed to run the FTP upload operation

Hi,
We are using WinSCP 5.1.0 version now we upgrade to 5.7.6 and with this version we are facing issue after connecting FTP host and enter cd .. command.

Following code in batch file (C:\tmp\TestUpload.bat) that we are running using following command

============TestUpload.bat========================
open ftp://user:password@10.xxx.10.xxx:9326
cd ..
cd ..
cd ..
put "C:\Automation\TestData\BFET.111300.txt"
exit
==================================================

============ WinSCP FTP Command ========================
Q:\GPL_WinSCP_5.7.6_R1.0\WinSCP>WinSCP.com /script="C:\tmp\TestUpload.bat" /log="c:\tmp\winscp.log"
Connecting to 10.xxx.10.xxx:9326 ...
Connected
Starting the session...
Session started.
Active session: [1] user@10.xxx.10.xxx
Error changing directory to '..'.
..: No such file or directory.
/

Q:\GPL_WinSCP_5.7.6_R1.0\WinSCP>

====================================================================

The issue is after login to FTP host the /root directory empty no sub directories.
Whenever the first command cd .. executed it gives above error and not exeuting PUT command

This is working fine with older version 4.3.4 and 5.1.0.

The same error found from WinSCP UI after login to ftp host click on /root directory it throws same error.

we have many scripts that are impacted with this command operation on 5.7.6 version. If /root directory has sub directories then we are not getting above error.

Please help me in this case. Let me know if you need any more info.

Following is log for this issue
LOG
==================================================

. 2016-03-02 10:41:20.027 --------------------------------------------------------------------------
. 2016-03-02 10:41:20.028 WinSCP Version 5.7.6 (Build 5874) (OS 6.1.7601 Service Pack 1 - Windows 7 Enterprise)
. 2016-03-02 10:41:20.028 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2016-03-02 10:41:20.028 Log level: Normal
. 2016-03-02 10:41:20.028 Local account: OFFICELOCAL\shirish.kabade
. 2016-03-02 10:41:20.028 Working directory: Q:\GPL_WinSCP_5.7.6_R1.0\WinSCP
. 2016-03-02 10:41:20.028 Process ID: 547208
. 2016-03-02 10:41:20.028 Command-line: "Q:\GPL_WinSCP_5.7.6_R1.0\WinSCP\WinSCP.exe" /console=576 /consoleinstance=_547560_157 "/script=C:\tmp\TestUpload.bat" "/log=c:\tmp\winscp.log"
. 2016-03-02 10:41:20.029 Time zone: Current: GMT+0, Standard: GMT+0 (GMT Standard Time), DST: GMT+1 (GMT Daylight Time), DST Start: 27/03/2016, DST End: 30/10/2016
. 2016-03-02 10:41:20.030 Login time: 02 March 2016 10:41:20
. 2016-03-02 10:41:20.030 --------------------------------------------------------------------------
. 2016-03-02 10:41:20.030 Script: Retrospectively logging previous script records:
> 2016-03-02 10:41:20.030 Script: open ftp://user:***@10.xxx.20.xxx:9326
. 2016-03-02 10:41:20.030 --------------------------------------------------------------------------
. 2016-03-02 10:41:20.030 Session name: user@10.xxx.20.xxx (Ad-Hoc site)
. 2016-03-02 10:41:20.030 Host name: 10.xxx.20.xxx (Port: 9326)
. 2016-03-02 10:41:20.030 User name: user (Password: Yes, Key file: No)
. 2016-03-02 10:41:20.030 Transfer Protocol: FTP
. 2016-03-02 10:41:20.030 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2016-03-02 10:41:20.030 Disable Nagle: No
. 2016-03-02 10:41:20.030 Proxy: none
. 2016-03-02 10:41:20.030 Send buffer: 262144
. 2016-03-02 10:41:20.030 UTF: 2
. 2016-03-02 10:41:20.030 FTP: FTPS: None; Passive: Yes [Force IP: A]; MLSD: A [List all: A]
. 2016-03-02 10:41:20.031 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-03-02 10:41:20.031 Cache directory changes: Yes, Permanent: Yes
. 2016-03-02 10:41:20.031 Timezone offset: 0h 0m
. 2016-03-02 10:41:20.031 --------------------------------------------------------------------------
. 2016-03-02 10:41:20.048 Connecting to 10.xxx.20.xxx:9326 ...
. 2016-03-02 10:41:20.049 Connected with 10.xxx.20.xxx:9326. Waiting for welcome message...
< 2016-03-02 10:41:20.051 220 Service ready for new user..
> 2016-03-02 10:41:20.051 USER user
< 2016-03-02 10:41:20.052 331 User name okay, need password for user.
> 2016-03-02 10:41:20.052 PASS ********
< 2016-03-02 10:41:20.053 230 User logged in, proceed.
> 2016-03-02 10:41:20.053 SYST
< 2016-03-02 10:41:20.055 215 UNIX Type: L8.
> 2016-03-02 10:41:20.055 FEAT
< 2016-03-02 10:41:20.055 502 Command FEAT not implemented.
. 2016-03-02 10:41:20.056 Connected
. 2016-03-02 10:41:20.056 --------------------------------------------------------------------------
. 2016-03-02 10:41:20.056 Using FTP protocol.
. 2016-03-02 10:41:20.056 Doing startup conversation with host.
> 2016-03-02 10:41:20.056 PWD
< 2016-03-02 10:41:20.058 257 "/" is current working directory.
. 2016-03-02 10:41:20.058 Getting current directory name.
. 2016-03-02 10:41:20.058 Startup conversation with host finished.
< 2016-03-02 10:41:20.058 Script: Active session: [1] user@10.xxx.20.xxx
> 2016-03-02 10:41:20.059 Script: cd ..
. 2016-03-02 10:41:20.059 Changing directory to "..".
> 2016-03-02 10:41:20.059 CWD ..
< 2016-03-02 10:41:20.060 550 ..: No such file or directory.
* 2016-03-02 10:41:20.060 (ECommand) Error changing directory to '..'.
* 2016-03-02 10:41:20.060 ..: No such file or directory.
< 2016-03-02 10:41:20.060 Script: Error changing directory to '..'.
< 2016-03-02 10:41:20.061 Script: ..: No such file or directory.
< 2016-03-02 10:41:20.061 Script: /
. 2016-03-02 10:41:20.061 Script: Failed
. 2016-03-02 10:41:20.061 Script: Exit code: 1
. 2016-03-02 10:41:20.062 Disconnected from server

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: WinSCP command failed to run the FTP upload operation

You start in the root, so why do you do cd ..?

Show us a log file from 5.1 for comparison.

Reply with quote

shirishvoca
Joined:
Posts:
1
Location:
United Kingdom

Some user after login it shows home directory of user e.g. \user\home\username and other FTP user not set any home directory so it goes to /root directory.

Here is the log from 5.1.0 where its not thorwing any error at three times changing directory i.e. cd..and continue and exit script without any issue. (log shows "C:\tmp\TestData\D100817.bat" missing i did it purposly to show script code works in 5.1.0 but not in 5.7.6

Please review the log and let me know if you have any suggestion around this issue.

======== 5.1.0 log =======================================


. 2016-03-08 13:35:45.280 --------------------------------------------------------------------------
. 2016-03-08 13:35:45.280 WinSCP Version 5.1.0 (Build 2625) (OS 5.1.2600 Service Pack 3)
. 2016-03-08 13:35:45.280 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2016-03-08 13:35:45.280 Local account: XXXXX\XXXXX.XXXXX
. 2016-03-08 13:35:45.280 Working directory: C:\Program Files\WinSCP510
. 2016-03-08 13:35:45.280 Command-line: "C:\Program Files\WinSCP510\WinSCP.exe" /console=510 /consoleinstance=_5576_344 "/script=C:\tmp\TestUpload.bat" "/log=c:\tmp\winscp.log"
. 2016-03-08 13:35:45.280 Login time: 08 March 2016 13:35:45
. 2016-03-08 13:35:45.280 --------------------------------------------------------------------------
. 2016-03-08 13:35:45.280 Session name: user@10.xxx.10.xxx (Modified stored session)
. 2016-03-08 13:35:45.280 Host name: 10.xxx.10.xxx (Port: 9326)
. 2016-03-08 13:35:45.280 User name: user (Password: Yes, Key file: No)
. 2016-03-08 13:35:45.280 Tunnel: No
. 2016-03-08 13:35:45.280 Transfer Protocol: FTP
. 2016-03-08 13:35:45.280 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2016-03-08 13:35:45.280 Proxy: none
. 2016-03-08 13:35:45.280 FTP: FTPS: None; Passive: Yes [Force IP: A]
. 2016-03-08 13:35:45.280 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-03-08 13:35:45.280 Cache directory changes: Yes, Permanent: Yes
. 2016-03-08 13:35:45.280 DST mode: 1
. 2016-03-08 13:35:45.280 --------------------------------------------------------------------------
. 2016-03-08 13:35:45.280 Connecting to 10.xxx.10.xxx:9326 ...
. 2016-03-08 13:35:45.280 Connected with 10.xxx.10.xxx:9326. Waiting for welcome message...
< 2016-03-08 13:35:45.296 220 Service ready for new user..
> 2016-03-08 13:35:45.296 USER user
< 2016-03-08 13:35:45.296 331 User name okay, need password for user.
> 2016-03-08 13:35:45.296 PASS ********
< 2016-03-08 13:35:45.296 230 User logged in, proceed.
> 2016-03-08 13:35:45.296 SYST
< 2016-03-08 13:35:45.296 215 UNIX Type: L8.
> 2016-03-08 13:35:45.296 FEAT
< 2016-03-08 13:35:45.296 502 Command FEAT not implemented.
. 2016-03-08 13:35:45.296 Connected
. 2016-03-08 13:35:45.296 --------------------------------------------------------------------------
. 2016-03-08 13:35:45.296 Using FTP protocol.
. 2016-03-08 13:35:45.296 Doing startup conversation with host.
> 2016-03-08 13:35:45.296 PWD
< 2016-03-08 13:35:45.296 257 "/" is current working directory.
. 2016-03-08 13:35:45.296 Getting current directory name.
. 2016-03-08 13:35:45.296 Startup conversation with host finished.
< 2016-03-08 13:35:45.296 Script: Active session: [1] user@10.xxx.10.xxx
> 2016-03-08 13:35:45.296 Script: cd ..
. 2016-03-08 13:35:45.296 Cached directory change via ".." to "/".
. 2016-03-08 13:35:45.296 Getting current directory name.
< 2016-03-08 13:35:45.296 Script: /
> 2016-03-08 13:35:45.296 Script: cd ..
. 2016-03-08 13:35:45.296 Cached directory change via ".." to "/".
. 2016-03-08 13:35:45.296 Getting current directory name.
< 2016-03-08 13:35:45.296 Script: /
> 2016-03-08 13:35:45.296 Script: cd ..
. 2016-03-08 13:35:45.296 Cached directory change via ".." to "/".
. 2016-03-08 13:35:45.296 Getting current directory name.
< 2016-03-08 13:35:45.296 Script: /
> 2016-03-08 13:35:45.296 Script: put "C:\tmp\TestData\D100817.bat"
. 2016-03-08 13:35:45.327 Copying 1 files/directories to remote directory "/"
. 2016-03-08 13:35:45.327 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask:
. 2016-03-08 13:35:45.327 TM: B; ClAr: No; CPS: 0; InclM:
. 2016-03-08 13:35:45.327 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2016-03-08 13:35:45.327 File: "C:\tmp\TestData\D100817.bat"
* 2016-03-08 13:35:45.390 (EOSError) System Error. Code: 2.

* 2016-03-08 13:35:45.390 The system cannot find the file specified
. 2016-03-08 13:35:45.390 Asking user:
. 2016-03-08 13:35:45.390 File or folder 'C:\tmp\TestData\D100817.bat' does not exist. ("System Error. Code: 2.

. 2016-03-08 13:35:45.390 The system cannot find the file specified")
< 2016-03-08 13:35:45.390 Script: File or folder 'C:\tmp\TestData\D100817.bat' does not exist.
< 2016-03-08 13:35:45.390 Script: System Error. Code: 2.

< 2016-03-08 13:35:45.390 The system cannot find the file specified
* 2016-03-08 13:35:49.874 (EScpSkipFile) File or folder 'C:\tmp\TestData\D100817.bat' does not exist.
* 2016-03-08 13:35:49.874 System Error. Code: 2.
* 2016-03-08 13:35:49.874 The system cannot find the file specified
. 2016-03-08 13:35:49.874 Script: Failed
> 2016-03-08 13:35:49.874 Script: exit
. 2016-03-08 13:35:49.874 Script: Exit code: 1
. 2016-03-08 13:35:49.874 Disconnected from server

Reply with quote

Advertisement

You can post new topics in this forum