Topic "Folder Name and File name issues (automation script)"

Author Message
lswalker85
[View user's profile]

Joined: 2014-12-10
Posts: 3
Hey, I run an automation script across multiple FTP Sites and have had no issues until one weekend one of the three shows /'s before and after each folder as well as full path for folders and files.
This is causing issues with downloading files as the path cannot be found. When I use the Copy to Clipboard (Include Path) I get /EDI/Emdeon/2014/NewFiles//EDI/Emdeon/2014/NewFiles/m837.20141208.POD4.05143. The actual path is /EDI/Emdeon/2014/NewFiles/m837.20141208.POD4.05143.
I've checked with the FTP Server and they say it looks fine from their side. Filezilla also shows no /folder/ names.
Any idea how to get WinSCP to recognize file and folder names as the other sessions do?
Thanks for the help.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
_________________
Martin Prikryl
lswalker85
[View user's profile]

Joined: 2014-12-10
Posts: 3
WinSCP version: 5.5.6 (Build 4767)

Session Log, my comments added as // ME - :
. 2014-12-12 11:05:33.657 --------------------------------------------------------------------------
. 2014-12-12 11:05:33.657 WinSCP Version 5.5.6 (Build 4746) (OS 6.1.7601 Service Pack 1 - Windows 7 Enterprise)
. 2014-12-12 11:05:33.657 Configuration: C:\Program Files (x86)\WinSCP\WinSCP.ini
. 2014-12-12 11:05:33.657 Local account: HOME\ME
. 2014-12-12 11:05:33.657 Working directory: C:\Windows\system32
. 2014-12-12 11:05:33.657 Process ID: 3236
. 2014-12-12 11:05:33.657 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" "SPH" /UploadIfAny /JumpList
. 2014-12-12 11:05:33.667 Time zone: Current: GMT-8, Standard: GMT-8 (Pacific Standard Time), DST: GMT-7 (Pacific Daylight Time), DST Start: 3/9/2014, DST End: 11/2/2014
. 2014-12-12 11:05:33.667 Login time: Friday, December 12, 2014 11:05:33 AM
. 2014-12-12 11:05:33.667 --------------------------------------------------------------------------
// ME - Connection part removed.
. 2014-12-12 11:05:35.395 --------------------------------------------------------------------------
. 2014-12-12 11:05:35.395 Using SFTP protocol.
. 2014-12-12 11:05:35.395 Doing startup conversation with host.
> 2014-12-12 11:05:35.445 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2014-12-12 11:05:35.515 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2014-12-12 11:05:35.515 SFTP version 3 negotiated.
. 2014-12-12 11:05:35.525 We believe the server has signed timestamps bug
. 2014-12-12 11:05:35.525 We will use UTF-8 strings when appropriate
// ME - /EDI/Emdeon/2014 is the remembered last used directory.
. 2014-12-12 11:05:35.545 Changing directory to "/EDI/Emdeon/2014".
. 2014-12-12 11:05:35.545 Getting real path for '/EDI/Emdeon/2014'
> 2014-12-12 11:05:35.545 Type: SSH_FXP_REALPATH, Size: 25, Number: 16
< 2014-12-12 11:05:35.615 Type: SSH_FXP_NAME, Size: 55, Number: 16
. 2014-12-12 11:05:35.615 Real path is '/EDI/Emdeon/2014'
. 2014-12-12 11:05:35.615 Trying to open directory "/EDI/Emdeon/2014".
> 2014-12-12 11:05:35.615 Type: SSH_FXP_LSTAT, Size: 25, Number: 263
< 2014-12-12 11:05:35.685 Type: SSH_FXP_ATTRS, Size: 21, Number: 263
. 2014-12-12 11:05:35.685 Getting current directory name.
. 2014-12-12 11:05:35.845 Listing directory "/EDI/Emdeon/2014".
> 2014-12-12 11:05:35.845 Type: SSH_FXP_OPENDIR, Size: 25, Number: 523
< 2014-12-12 11:05:35.915 Type: SSH_FXP_HANDLE, Size: 10, Number: 523
> 2014-12-12 11:05:35.915 Type: SSH_FXP_READDIR, Size: 10, Number: 780
< 2014-12-12 11:05:35.995 Type: SSH_FXP_NAME, Size: 233, Number: 780
> 2014-12-12 11:05:35.995 Type: SSH_FXP_READDIR, Size: 10, Number: 1036
< 2014-12-12 11:05:36.065 Type: SSH_FXP_STATUS, Size: 22, Number: 1036
< 2014-12-12 11:05:36.065 Status code: 1
> 2014-12-12 11:05:36.065 Type: SSH_FXP_CLOSE, Size: 10, Number: 1284
. 2014-12-12 11:05:36.065 /EDI/Emdeon/2014/Archive/;d;0;2014-12-11T22:24:34.000Z;"user" [0];"group" [0];rwxrw-rw-;1
. 2014-12-12 11:05:36.065 /EDI/Emdeon/2014/NewFiles/;d;0;2014-12-12T14:05:11.000Z;"user" [0];"group" [0];rwxrw-rw-;1
. 2014-12-12 11:05:36.145 Startup conversation with host finished.
// ME - Tried changing to a 'blank' directory in the directory tree pane.
. 2014-12-12 11:05:41.834 Changing directory to "/EDI/Emdeon/2014//EDI/Emdeon/2014/Archive/".
. 2014-12-12 11:05:41.834 Getting real path for '/EDI/Emdeon/2014//EDI/Emdeon/2014/Archive/'
> 2014-12-12 11:05:41.834 Type: SSH_FXP_REALPATH, Size: 51, Number: 1552
< 2014-12-12 11:05:41.844 Type: SSH_FXP_STATUS, Size: 21, Number: 1284
. 2014-12-12 11:05:41.844 Discarding reserved response
< 2014-12-12 11:05:41.914 Type: SSH_FXP_STATUS, Size: 33, Number: 1552
< 2014-12-12 11:05:41.914 Status code: 2, Message: 1552, Server: File not found, Language: en
* 2014-12-12 11:05:41.914 (ECommand) Error changing directory to '/EDI/Emdeon/2014//EDI/Emdeon/2014/Archive/'.
* 2014-12-12 11:05:41.914 Cannot get real path for '/EDI/Emdeon/2014//EDI/Emdeon/2014/Archive/'.
* 2014-12-12 11:05:41.914 No such file or directory.
* 2014-12-12 11:05:41.914 Error code: 2
* 2014-12-12 11:05:41.914 Error message from server (en): File not found
// ME - Tried changing to the other 'blank' directory in the directory tree pane.
. 2014-12-12 11:05:44.147 Changing directory to "/EDI/Emdeon/2014//EDI/Emdeon/2014/NewFiles/".
. 2014-12-12 11:05:44.147 Getting real path for '/EDI/Emdeon/2014//EDI/Emdeon/2014/NewFiles/'
> 2014-12-12 11:05:44.147 Type: SSH_FXP_REALPATH, Size: 52, Number: 1808
< 2014-12-12 11:05:44.227 Type: SSH_FXP_STATUS, Size: 33, Number: 1808
< 2014-12-12 11:05:44.227 Status code: 2, Message: 1808, Server: File not found, Language: en
* 2014-12-12 11:05:44.227 (ECommand) Error changing directory to '/EDI/Emdeon/2014//EDI/Emdeon/2014/NewFiles/'.
* 2014-12-12 11:05:44.227 Cannot get real path for '/EDI/Emdeon/2014//EDI/Emdeon/2014/NewFiles/'.
* 2014-12-12 11:05:44.227 No such file or directory.
* 2014-12-12 11:05:44.227 Error code: 2
* 2014-12-12 11:05:44.227 Error message from server (en): File not found
// ME - Used File List pane to change into the NewFiles folder (note: Folder shows as "/EDI/Emdeon/2014/NewFiles/"
. 2014-12-12 11:05:45.768 Cached directory change via "/EDI/Emdeon/2014/NewFiles/" to "/EDI/Emdeon/2014/NewFiles".
. 2014-12-12 11:05:45.768 Getting current directory name.
. 2014-12-12 11:05:45.768 Listing directory "/EDI/Emdeon/2014/NewFiles".
> 2014-12-12 11:05:45.768 Type: SSH_FXP_OPENDIR, Size: 34, Number: 2059
< 2014-12-12 11:05:45.848 Type: SSH_FXP_HANDLE, Size: 10, Number: 2059
> 2014-12-12 11:05:45.848 Type: SSH_FXP_READDIR, Size: 10, Number: 2316
< 2014-12-12 11:05:45.918 Type: SSH_FXP_NAME, Size: 331, Number: 2316
> 2014-12-12 11:05:45.918 Type: SSH_FXP_READDIR, Size: 10, Number: 2572
< 2014-12-12 11:05:46.048 Type: SSH_FXP_STATUS, Size: 22, Number: 2572
< 2014-12-12 11:05:46.058 Status code: 1
> 2014-12-12 11:05:46.058 Type: SSH_FXP_CLOSE, Size: 10, Number: 2820
// ME - NewFiles has two files in it, in the File pane they show as "/EDI/Emdeon/2014/NewFiles/h837.20141211.POD4.05173" and not as just "h837.20141211.POD4.05173"
. 2014-12-12 11:05:46.058 /EDI/Emdeon/2014/NewFiles/h837.20141211.POD4.05173;-;2445;2014-12-12T14:05:10.000Z;"user" [0];"group" [0];rw-rw-rw-;1
. 2014-12-12 11:05:46.058 /EDI/Emdeon/2014/NewFiles/m837.20141211.POD4.05175;-;8365;2014-12-12T14:05:10.000Z;"user" [0];"group" [0];rw-rw-rw-;1
. 2014-12-12 11:05:54.154 Closing connection.
. 2014-12-12 11:05:54.154 Sending special code: 12
. 2014-12-12 11:05:54.154 Sent EOF message

Thanks!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
So it's SFTP server, not FTP.
Your SFTP server seems to use full path to a file in directory listing, instead of name-only, what violates the specification. That confuses WinSCP.

Quoting https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13

Quote:
A file name being returned (for SSH_FXP_READDIR, it will be a
relative name within the directory, without any path components;
for SSH_FXP_REALPATH it will be an absolute path name.)



What is your SFTP server? (You have removed that important information from the log).
_________________
Martin Prikryl
lswalker85
[View user's profile]

Joined: 2014-12-10
Posts: 3
Hey - Here's the removed connections. Since I don't own/manage this server I've removed Host and usernames.

. 2014-12-12 11:05:33.667 Session name: SPH (Site)
. 2014-12-12 11:05:33.667 Host name: [Removed]
. 2014-12-12 11:05:33.667 User name: [Removed] (Password: Yes, Key file: No)
. 2014-12-12 11:05:33.667 Tunnel: No
. 2014-12-12 11:05:33.667 Transfer Protocol: SFTP (SCP)
. 2014-12-12 11:05:33.667 Ping type: N, Ping interval: 30 sec; Timeout: 15 sec
. 2014-12-12 11:05:33.667 Proxy: none
. 2014-12-12 11:05:33.667 Send buffer: 262144
. 2014-12-12 11:05:33.667 SSH protocol version: 2; Compression: No
. 2014-12-12 11:05:33.667 Bypass authentication: No
. 2014-12-12 11:05:33.667 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2014-12-12 11:05:33.667 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2014-12-12 11:05:33.667 SSH Bugs: A,A,A,A,A,A,A,A,A,A
. 2014-12-12 11:05:33.667 Simple channel: Yes
. 2014-12-12 11:05:33.667 Return code variable: Autodetect; Lookup user groups: A
. 2014-12-12 11:05:33.667 Shell: default
. 2014-12-12 11:05:33.667 EOL: 0, UTF: 2
. 2014-12-12 11:05:33.667 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2014-12-12 11:05:33.667 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2014-12-12 11:05:33.667 SFTP Bugs: A,A
. 2014-12-12 11:05:33.667 SFTP Server: default
. 2014-12-12 11:05:33.677 Local directory: C:\, Remote directory: /EDI/Emdeon/2014, Update: Yes, Cache: Yes
. 2014-12-12 11:05:33.677 Cache directory changes: Yes, Permanent: Yes
. 2014-12-12 11:05:33.677 DST mode: 1; Timezone offset: 0h 0m
. 2014-12-12 11:05:33.677 --------------------------------------------------------------------------
. 2014-12-12 11:05:33.737 Looking up host "[Removed]"
. 2014-12-12 11:05:33.747 Connecting to [Removed] port [Removed]
. 2014-12-12 11:05:33.939 Server version: SSH-2.0-sshlib
. 2014-12-12 11:05:33.939 Using SSH protocol version 2
. 2014-12-12 11:05:33.939 We claim version: SSH-2.0-WinSCP_release_5.5.6
. 2014-12-12 11:05:34.009 Doing Diffie-Hellman group exchange
. 2014-12-12 11:05:34.209 Doing Diffie-Hellman key exchange with hash SHA-1
. 2014-12-12 11:05:34.600 Verifying host key [Removed]
. 2014-12-12 11:05:34.642 Host key matches cached key
. 2014-12-12 11:05:34.642 Host key fingerprint is:
. 2014-12-12 11:05:34.642 [Removed]
. 2014-12-12 11:05:34.642 Initialised AES-256 SDCTR client->server encryption
. 2014-12-12 11:05:34.642 Initialised HMAC-SHA1 client->server MAC algorithm
. 2014-12-12 11:05:34.642 Initialised AES-256 SDCTR server->client encryption
. 2014-12-12 11:05:34.642 Initialised HMAC-SHA1 server->client MAC algorithm
! 2014-12-12 11:05:34.932 Using username "[Removed]".
. 2014-12-12 11:05:35.012 Attempting keyboard-interactive authentication
. 2014-12-12 11:05:35.092 Prompt (6, SSH server authentication, Using keyboard-interactive authentication., Enter password: )
. 2014-12-12 11:05:35.092 Using stored password.
. 2014-12-12 11:05:35.232 Access granted
. 2014-12-12 11:05:35.232 Opening session as main channel
. 2014-12-12 11:05:35.305 Opened main channel
. 2014-12-12 11:05:35.375 Started a shell/command
. 2014-12-12 11:05:35.395 --------------------------------------------------------------------------

Thanks!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
It looks like some custom-built server.

Well, the server clearly violates the specification. And as it does not seem to be widely used, it's not worth investing to workaround on client-side. I'm sorry.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License