"Can't get attributes of file"

Advertisement

Guest

"Can't get attributes of file"

I am brand new to WinSCP. I've looked at the FAQ and troubleshooting guide and don't find the answer to this problem.

When I am trying to transfer a binary file I receive the error
Can't get attributes of file (filename).
The additional information from the More button is
Invalid argument to date encode.
Do you know what is causing the error message and how I resolve this?
Thanks!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,262
Location:
Prague, Czechia

Re: "Can't get attributes of file"

I guess you are uploading files, are you? Where from? What version of WinSCP are you using? Have you tried the latest one?

Reply with quote

Guest

Thanks for your reply. Yes, I am uploading files from a local drive. The WinSCP version is 3.7.6 (build 306). I can try downloading the latest version for this limited use. I normally just ftp to the other unix servers. This is a temporary server which the Unix admin recommended using WinSCP instead of ftp. I'll try the new version and if that is unsuccessful I'll contact the server admin.

Thanks!

Reply with quote

Guest2
Guest

Re: "Can't get attributes of file"

I have got the same error. I solved it removing archive check in the file properties. Yan

Reply with quote

Advertisement

bitjunky
Guest

Wildcard (*) fixed the Can't get attributes of file

Just recently had this problem when our provider moved to ftp.drivehq.com
Not sure why but if I use a wildcard (*) in the filename it worked!
Example:
get *.*
or
get AnyFile*.zip

Reply with quote

jreopelle
Joined:
Posts:
1
Location:
Green Bay, WI

Re: Wildcard (*) fixed the Can't get attributes of file

@martin: I am running 5.5.4 and I am seeing the same thing with ftp.drivehq.com. Will there be a fix for this situation?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,262
Location:
Prague, Czechia

Re: Wildcard (*) fixed the Can't get attributes of file

@jreopelle: Thanks for your report. I was able to reproduce the problem against ftp.hrivehq.com server.

I believe it's a bug on their side. I have submitted a report on their support forum:
"Bad sequence of commands" error in reponse to MLST command. DriveHQ Cloud IT Service Support Forum

Meanwhile you can workaround the bug by configuring WinSCP to avoid MLST command.
For that you have to upgrade to WinSCP 5.6 beta and set Use MLSD command for directory listing to Off.
https://winscp.net/eng/docs/ui_login_ftp
(The option affects also MLST command, but only since 5.6 beta:
Issue 1181 – Make "Use MLSD command for directory listing" affect also use of MLST command)

Reply with quote

ftp.DriveHQ.com
Guest

We have fixed the bug

Thank you for reporting the problem to DriveHQ. It seems our engineers mixed MLST and MLSD, and required a data connection for MLST... The bug has been fixed.

Reply with quote

ziotibia81
Joined:
Posts:
2

ownCloud bug?

Hello,
I revive this old post.

I'm using WinSCP scripting to download a file from a local instance of ownCloud.
The protocol is WebDAV. I have the same problem described here... In my case:
get file.rar.aes
Can't get attributes of file (filename)
get file.rar*.aes
successfully download.

WinSCP is version 5.7.1525
ownCloud version 8.0.2

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,262
Location:
Prague, Czechia

Re: ownCloud bug?

@ziotibia81: Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. 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.

Reply with quote

ziotibia81
Joined:
Posts:
2

Re: ownCloud bug?

added private attachment
  • log-success.txt (22.19 KB, Private file)
Description: Log of regular download
  • log-fail.txt (17.65 KB, Private file)
Description: Log of failed download

Reply with quote

Guest4
Guest

Re: ownCloud bug?

I have got the same error, but I can't find workaround.
If I put * in file name I've got
Error listing directory '/MyDirName'.
500 Internal Server Error
A)bort, (R)etry, (S)kip: Abort
If I put exact file name I've got
Can't get attributes of file 'MyFileName.zip'.
500 Internal Server Error
I use WebDAV protocol. WinSCP Version 5.7 (Build 5125)

Could you please help on it?
Thank you in advance!

Reply with quote

Alexander.Moiseev
Guest

Re: ownCloud bug?

I've got the same error with WinSCP Version 5.7.1 (Build 5235)
I used script and .NET assembly.
And I used proxy for HTTP.

Reply with quote

Advertisement

Alexander.Moiseev
Guest

Re: ownCloud bug?

Dear Martin,

Are there any good news regarding this issue?
Thank you in advance!

Regards,
Alexander

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,262
Location:
Prague, Czechia

Re: ownCloud bug?

@Guest4: Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. 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.

Reply with quote

TPMTL
Guest

Can't get attributes of file

Hello,
We have the same issue.

On the same FTP server, one file works, another one gives the following error:
Can't get attributes of file 'budget_out.txt'.
Could not retrieve file information
Could not get file size.
Any help would be appreciated.
Thank you!
 2015-08-26 15:39:24.054 --------------------------------------------------------------------------
. 2015-08-26 15:39:24.054 WinSCP Version 5.7.5 (Build 5665) (OS 6.3.9600 - Windows Server 2012 R2 Datacenter)
. 2015-08-26 15:39:24.054 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2015-08-26 15:39:24.054 Log level: Normal
. 2015-08-26 15:39:24.054 Local account: ***********************
. 2015-08-26 15:39:24.054 Working directory: C:\Donnees\RSS
. 2015-08-26 15:39:24.054 Process ID: 4872
. 2015-08-26 15:39:24.054 Command-line: "c:\winscp\WinSCP.exe" /console=575 /consoleinstance=_1912_411 "/command" "open ftp://**********************/" "get budget_out.txt" "exit" "/log=C:\ftpscp.log" 
. 2015-08-26 15:39:24.054 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 3/8/2015, DST End: 11/1/2015
. 2015-08-26 15:39:24.054 Login time: Wednesday, August 26, 2015 3:39:24 PM
. 2015-08-26 15:39:24.054 --------------------------------------------------------------------------
. 2015-08-26 15:39:24.054 Script: Retrospectively logging previous script records:
> 2015-08-26 15:39:24.054 Script: open ftp://*******************/
. 2015-08-26 15:39:24.054 --------------------------------------------------------------------------
. 2015-08-26 15:39:24.054 Session name: ***************(Ad-Hoc site)
. 2015-08-26 15:39:24.054 Host name: **************** (Port: 21)
. 2015-08-26 15:39:24.054 User name: ****** (Password: Yes, Key file: No)
. 2015-08-26 15:39:24.054 Transfer Protocol: FTP
. 2015-08-26 15:39:24.054 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2015-08-26 15:39:24.054 Disable Nagle: No
. 2015-08-26 15:39:24.054 Proxy: none
. 2015-08-26 15:39:24.054 Send buffer: 262144
. 2015-08-26 15:39:24.054 UTF: 2
. 2015-08-26 15:39:24.054 FTP: FTPS: None; Passive: Yes [Force IP: A]; MLSD: A [List all: A]
. 2015-08-26 15:39:24.054 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2015-08-26 15:39:24.054 Cache directory changes: Yes, Permanent: Yes
. 2015-08-26 15:39:24.054 Timezone offset: 0h 0m
. 2015-08-26 15:39:24.054 --------------------------------------------------------------------------
. 2015-08-26 15:39:24.069 Connecting to ***************...
. 2015-08-26 15:39:24.085 Connected with ***************. Waiting for welcome message...
< 2015-08-26 15:39:24.116 220 (vsFTPd 2.0.5)
> 2015-08-26 15:39:24.116 USER *******
< 2015-08-26 15:39:24.132 331 Please specify the password.
> 2015-08-26 15:39:24.132 PASS *********
< 2015-08-26 15:39:24.163 230 Login successful.
> 2015-08-26 15:39:24.163 SYST
< 2015-08-26 15:39:24.194 215 UNIX Type: L8
> 2015-08-26 15:39:24.194 FEAT
< 2015-08-26 15:39:24.210 211-Features:
< 2015-08-26 15:39:24.210  EPRT
< 2015-08-26 15:39:24.226  EPSV
< 2015-08-26 15:39:24.226  MDTM
< 2015-08-26 15:39:24.226  PASV
< 2015-08-26 15:39:24.226  REST STREAM
< 2015-08-26 15:39:24.226  SIZE
< 2015-08-26 15:39:24.226  TVFS
< 2015-08-26 15:39:24.226 211 End
. 2015-08-26 15:39:24.226 Connected
. 2015-08-26 15:39:24.226 --------------------------------------------------------------------------
. 2015-08-26 15:39:24.226 Using FTP protocol.
. 2015-08-26 15:39:24.226 Doing startup conversation with host.
> 2015-08-26 15:39:24.241 PWD
< 2015-08-26 15:39:24.257 257 "/"
. 2015-08-26 15:39:24.257 Getting current directory name.
. 2015-08-26 15:39:24.257 Startup conversation with host finished.
< 2015-08-26 15:39:24.257 Script: Active session: [1] **************
> 2015-08-26 15:39:24.257 Script: get budget_out.txt
. 2015-08-26 15:39:24.257 Listing file "budget_out.txt".
. 2015-08-26 15:39:24.257 Retrieving file information...
> 2015-08-26 15:39:24.257 PWD
< 2015-08-26 15:39:24.288 257 "/"
> 2015-08-26 15:39:24.288 CWD /budget_out.txt
< 2015-08-26 15:39:24.304 550 Failed to change directory.
> 2015-08-26 15:39:24.304 TYPE I
< 2015-08-26 15:39:24.335 200 Switching to Binary mode.
> 2015-08-26 15:39:24.335 SIZE /budget_out.txt
< 2015-08-26 15:39:24.351 550 Could not get file size.
. 2015-08-26 15:39:24.351 Could not retrieve file information
< 2015-08-26 15:39:24.351 Script: Can't get attributes of file 'budget_out.txt'.
< 2015-08-26 15:39:24.351 Script: Could not retrieve file information
 
< 2015-08-26 15:39:24.351 Could not get file size.
. 2015-08-26 15:39:24.351 Script: Failed
. 2015-08-26 15:39:24.351 Script: Exit code: 1
. 2015-08-26 15:39:24.351 Disconnected from server

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,262
Location:
Prague, Czechia

Re: Can't get attributes of file

@TPMTL:
> 2015-08-26 15:39:24.335 SIZE /budget_out.txt
< 2015-08-26 15:39:24.351 550 Could not get file size.
The error comes from the FTP server. I do not know why it fails to retrieve file size.
Do you have access to FTP server logs?

Can you show us a log for file that works?

Reply with quote

mrsmalltalk
Joined:
Posts:
10

Meanwhile you can workaround the bug by configuring WinSCP to avoid MLST command.
For that you have to upgrade to WinSCP 5.6 beta and set Use MLSD command for directory listing to Off.
Hi all,

I installed 5.8.1 beta and set the MLSD setting to Off. I still couldn't download the file (documented else where) and MLST still appeared in the log, so it appears MLSD = Off does not affect MLST. On a positive note using an * in a shortened filename led to success.

If you look at my post on this subject I posted a good log and a bad log to the same server and the same directory. I can send a good log on the same file that failed if you want it.

John

Reply with quote

mrsmalltalk
Joined:
Posts:
10

Hi,

since I posted this I've been using the asterisk. I've attached a log which was successful and includes a reference to MLSD. With that said I'm totally new to FTP so in all probability it's working as it should.

john

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,262
Location:
Prague, Czechia

@mrsmalltalk: You are using scripting and you are invoking the session using a session URL. So if you had disabled that option somewhere in GUI, it has no effect on the script whatsoever.

If you want to disable the "Use MLSD command for directory listing" option in scripting, use:
open ftp://anonymous@192.168.2.100:2121/66DATA99/Input/BocceLog/ -rawsettings FtpUseMlsd=1
See https://winscp.net/eng/docs/rawsettings

Though I do not really understand why you want to set the option at all. What problem are you having? I see no relation of your script to this topic.

Reply with quote

stevet
Guest

my way around the issue

While not 100% full proof as in some cases, this method may match multiple files.

I used the following to get around the issue:
GetFiles("Testfile.xls*", "/downloaddir/")
If you have files that are like the following, the this method will not work for you. In my case, the files are always unique.
Testfile.xls
Testfile.xls.backup

Reply with quote

Charan Ghate
Guest

can't get attributes of file Can't get attributes of file '/Test/data.csv'

I have getting this error only sometime. I am downloading same file from same server 100 times a day, out of 100 it work for 80 to 90, and fails for 10 with error
Can't get attributes of file '/Test/data.csv'.
What is the reason behind this?
Please do the needful.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,262
Location:
Prague, Czechia

Re: can't get attributes of file Can't get attributes of file '/Test/data.csv'

@Charan Ghate: Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. 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.

Reply with quote

Advertisement

Charan Ghate
Guest

Re: can't get attributes of file Can't get attributes of file '/Test/data.csv'

Thank you for your immediate response.
I am using WinSCP 5.7.6.5874 version.
The product is already in UAT, I have not getting this error in Dev and QA server, I am facing this only in UAT. For now it is not possible to make code changes to generate the Session log file. Can you please explain what are the possibilities of this error and what precaution is needed to avoid this exception? :( :( :(

Reply with quote

martin
Site Admin
martin avatar

Re: can't get attributes of file Can't get attributes of file '/Test/data.csv'

@Charan Ghate: I cannot give you any explanation without the log file.
Running a production code without having logging enabled is a major design fault.

Reply with quote

opti2k4
Guest

Re: can't get attributes of file Can't get attributes of file '/Test/data.csv'

Hi, I am having same issue
. 2016-04-13 07:53:45.373 Transfer done: 'C:\ftp\myplumbingshowroom\test2.txt' [5]
> 2016-04-13 07:53:45.842 Script: rm -- "C:\ftp\myplumbingshowroom\test2.txt"
. 2016-04-13 07:53:45.842 Listing file "C:\ftp\myplumbingshowroom\test2.txt".
. 2016-04-13 07:53:45.842 Retrieving file information...
> 2016-04-13 07:53:45.842 PWD
< 2016-04-13 07:53:45.983 257 "/" is current directory.
> 2016-04-13 07:53:45.983 CWD /C:\ftp\myplumbingshowroom\test2.txt
< 2016-04-13 07:53:46.139 550 The parameter is incorrect. 
> 2016-04-13 07:53:46.139 TYPE I
< 2016-04-13 07:53:46.280 200 Type set to I.
> 2016-04-13 07:53:46.280 SIZE /C:\ftp\myplumbingshowroom\test2.txt
< 2016-04-13 07:53:46.436 550 The parameter is incorrect. 
. 2016-04-13 07:53:46.436 Could not retrieve file information
< 2016-04-13 07:53:46.436 Script: Can't get attributes of file 'C:\ftp\myplumbingshowroom\test2.txt'.
< 2016-04-13 07:53:46.436 Script: Could not retrieve file information
 
< 2016-04-13 07:53:46.436 The parameter is incorrect.
. 2016-04-13 07:53:46.436 Script: Failed
> 2016-04-13 07:53:46.873 Script: exit
. 2016-04-13 07:53:46.873 Script: Exit code: 1
. 2016-04-13 07:53:46.873 Disconnected from server

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,262
Location:
Prague, Czechia

Re: can't get attributes of file Can't get attributes of file '/Test/data.csv'

@opti2k4: No you are not.
Your problem is that you are trying to remove a local file with WinSCP rm command, which is designed to remove remote files.
If you want to remove uploaded files, use
put -delete ...

Reply with quote

Advertisement

opti2k4
Guest

Re: can't get attributes of file Can't get attributes of file '/Test/data.csv'

@martin: Aha!

This is part of the code that is responsible for deletion. I am trying to delete local file after it is uploaded:
foreach ($upload in $synchronizationResult.Uploads)
{
    # Success or error?
    if ($upload.Error -eq $Null)
    {
        Write-Host ("Upload of {0} succeeded, removing from source" -f
            $upload.FileName)
        # Upload succeeded, remove file from source
 
        $removalResult = $session.RemoveFiles($session.EscapeFileMask($upload.FileName))
        if ($removalResult.IsSuccess)
        {
            Write-Host ("Removing of file {0} succeeded" -f
                $upload.FileName)
        }
        else
        {
            Write-Host ("Removing of file {0} failed" -f
                $upload.FileName)
        }
    }

Reply with quote

opti2k4
Guest

OK it's fixed
# Upload files to remote directory, collect results
$UploadResult = $session.Putfiles($localPath, $remotePath, $True)

Reply with quote

JvD
Guest

Can't get attributes of file

I searched quite a while for "Can't get attributes of file" while using a Windows Task with parameter.

The problem was in the parameter; the double quote before D:\Guidance was one too much, because of the long string I didn't notice it:
parameter:
/log=c:\temp\winscp.log /command "open sftp://catalogger:catalogger@10.12.3.1/home/catalogger -hostkey=""ssh-rsa 1024 xx:xx:xx:xx..."" -rawsettings FtpUseMlsd=1" "get attema_cataloggerdata.txt "D:\Guidance\Catalogger\Catalog\Update\ATT\" "exit"
This works fine now:
action: "C:\Program Files (x86)\WinSCP\WinSCP.exe"
parameter:
/log=c:\temp\winscp.log /command "open sftp://catalogger:catalogger@10.12.3.1/home/catalogger -hostkey=""ssh-rsa 1024 xx:xx:xx:xx..."" -rawsettings FtpUseMlsd=1" "get attema_cataloggerdata.txt D:\Guidance\Catalogger\Catalog\Update\ATT\" "exit"
. 2016-07-21 11:25:22.594 --------------------------------------------------------------------------
. 2016-07-21 11:25:22.594 WinSCP Version 5.7.7 (Build 6257) (OS 6.1.7601 Service Pack 1 - Windows 7 Professional)
. 2016-07-21 11:25:22.594 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2016-07-21 11:25:22.594 Log level: Normal
. 2016-07-21 11:25:22.594 Local account: BEHEERPC4\Beheerpc
. 2016-07-21 11:25:22.594 Working directory: C:\Windows\system32
. 2016-07-21 11:25:22.594 Process ID: 2060
. 2016-07-21 11:25:22.594 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log=c:\temp\winscp.log /command "open sftp://catalogger:catalogger@10.12.3.1/home/catalogger -hostkey=""ssh-rsa 1024 d9:a1:7e:b4:63:b3:4f:f4:94:86:6f:a9:ed:c5:92:67"" -rawsettings FtpUseMlsd=1" "get attema_cataloggerdata.txt "D:\Guidance\Catalogger\Catalog\Update\ATT\" "exit"
. 2016-07-21 11:25:22.594 Time zone: Current: GMT+2, Standard: GMT+1 (West-Europa (standaardtijd)), DST: GMT+2 (West-Europa (zomertijd)), DST Start: 27-3-2016, DST End: 30-10-2016
. 2016-07-21 11:25:22.594 Login time: donderdag 21 juli 2016 11:25:22
. 2016-07-21 11:25:22.594 --------------------------------------------------------------------------
. 2016-07-21 11:25:22.594 Script: Retrospectively logging previous script records:
> 2016-07-21 11:25:22.594 Script: open sftp://catalogger:***@10.12.3.1/home/catalogger -hostkey="ssh-rsa 1024 d9:a1:7e:b4:63:b3:4f:f4:94:86:6f:a9:ed:c5:92:67" -rawsettings FtpUseMlsd=1
. 2016-07-21 11:25:22.595 --------------------------------------------------------------------------
. 2016-07-21 11:25:22.595 Session name: catalogger@10.12.3.1 (Ad-Hoc site)
. 2016-07-21 11:25:22.595 Host name: 10.12.3.1 (Port: 22)
. 2016-07-21 11:25:22.595 User name: catalogger (Password: Yes, Key file: No)
. 2016-07-21 11:25:22.595 Tunnel: No
. 2016-07-21 11:25:22.595 Transfer Protocol: SFTP
. 2016-07-21 11:25:22.595 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2016-07-21 11:25:22.595 Disable Nagle: No
. 2016-07-21 11:25:22.595 Proxy: none
. 2016-07-21 11:25:22.595 Send buffer: 262144
. 2016-07-21 11:25:22.595 SSH protocol version: 2; Compression: No
. 2016-07-21 11:25:22.595 Bypass authentication: No
. 2016-07-21 11:25:22.595 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2016-07-21 11:25:22.595 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2016-07-21 11:25:22.595 KEX: dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,rsa,WARN
. 2016-07-21 11:25:22.595 SSH Bugs: A,A,A,A,A,A,A,A,A,A,A,A
. 2016-07-21 11:25:22.595 Simple channel: Yes
. 2016-07-21 11:25:22.595 Return code variable: Autodetect; Lookup user groups: A
. 2016-07-21 11:25:22.595 Shell: default
. 2016-07-21 11:25:22.595 EOL: 0, UTF: 2
. 2016-07-21 11:25:22.595 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2016-07-21 11:25:22.595 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2016-07-21 11:25:22.595 SFTP Bugs: A,A
. 2016-07-21 11:25:22.595 SFTP Server: default
. 2016-07-21 11:25:22.595 Local directory: default, Remote directory: /home/catalogger, Update: Yes, Cache: Yes
. 2016-07-21 11:25:22.595 Cache directory changes: Yes, Permanent: Yes
. 2016-07-21 11:25:22.595 DST mode: 1
. 2016-07-21 11:25:22.595 --------------------------------------------------------------------------
. 2016-07-21 11:25:22.595 Looking up host "10.12.3.1"
. 2016-07-21 11:25:22.595 Connecting to 10.12.3.1 port 22
. 2016-07-21 11:25:22.617 Server version: SSH-2.0-OpenSSH_5.1
. 2016-07-21 11:25:22.617 Using SSH protocol version 2
. 2016-07-21 11:25:22.617 We claim version: SSH-2.0-WinSCP_release_5.7.7
. 2016-07-21 11:25:22.619 Doing Diffie-Hellman group exchange
. 2016-07-21 11:25:22.621 Doing Diffie-Hellman key exchange with hash SHA-256
. 2016-07-21 11:25:23.850 Verifying host key rsa2 0x23,0xbcf72813731a70f5 a9b164776653f5fe 043aa55ea71b650f 9aed796c07e0815a 777cd23831413581 0dc72cbcc07f4117 9e4dc76f4f33d819 a8141628fa994627 7847e4a6c8c8af01 c82e85db0b077606 128e0fa6d9634cfc 4079b1374a665c03 bca3913ce2bc3453 af1937f37fa34cdf c117054619becb59 6168de9201b7cce1  with fingerprint ssh-rsa 1024 d9:a1:7e:b4:63:b3:4f:f4:94:86:6f:a9:ed:c5:92:67
. 2016-07-21 11:25:23.850 Host key matches configured key
. 2016-07-21 11:25:23.850 Host key fingerprint is:
. 2016-07-21 11:25:23.850 ssh-rsa 1024 d9:a1:7e:b4:63:b3:4f:f4:94:86:6f:a9:ed:c5:92:67
. 2016-07-21 11:25:23.850 Initialised AES-256 SDCTR client->server encryption
. 2016-07-21 11:25:23.850 Initialised HMAC-SHA1 client->server MAC algorithm
. 2016-07-21 11:25:23.850 Initialised AES-256 SDCTR server->client encryption
. 2016-07-21 11:25:23.851 Initialised HMAC-SHA1 server->client MAC algorithm
! 2016-07-21 11:25:23.891 Using username "catalogger".
. 2016-07-21 11:25:23.892 Attempting keyboard-interactive authentication
. 2016-07-21 11:25:23.895 Prompt (keyboard interactive, "SSH server authentication", "Using keyboard-interactive authentication.", "Password: ")
. 2016-07-21 11:25:23.895 Using stored password.
. 2016-07-21 11:25:23.900 Prompt (keyboard interactive, "SSH server authentication", <no instructions>, <no prompt>)
. 2016-07-21 11:25:23.901 Ignoring empty SSH server authentication request
. 2016-07-21 11:25:23.901 Access granted
. 2016-07-21 11:25:23.901 Opening session as main channel
. 2016-07-21 11:25:23.904 Opened main channel
. 2016-07-21 11:25:23.942 Started a shell/command
. 2016-07-21 11:25:23.942 --------------------------------------------------------------------------
. 2016-07-21 11:25:23.942 Using SFTP protocol.
. 2016-07-21 11:25:23.942 Doing startup conversation with host.
> 2016-07-21 11:25:23.942 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2016-07-21 11:25:23.990 Type: SSH_FXP_VERSION, Size: 95, Number: -1
. 2016-07-21 11:25:23.990 SFTP version 3 negotiated.
. 2016-07-21 11:25:23.990 Unknown server extension posix-rename@openssh.com="1"
. 2016-07-21 11:25:23.990 Supports statvfs@openssh.com extension version "2"
. 2016-07-21 11:25:23.990 Unknown server extension fstatvfs@openssh.com="2"
. 2016-07-21 11:25:23.990 We believe the server has signed timestamps bug
. 2016-07-21 11:25:23.990 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 string are not mandatory
. 2016-07-21 11:25:23.990 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2016-07-21 11:25:23.990 Changing directory to "/home/catalogger".
. 2016-07-21 11:25:23.990 Getting real path for '/home/catalogger'
> 2016-07-21 11:25:23.990 Type: SSH_FXP_REALPATH, Size: 25, Number: 16
< 2016-07-21 11:25:23.990 Type: SSH_FXP_NAME, Size: 53, Number: 16
. 2016-07-21 11:25:23.990 Real path is '/home/catalogger'
. 2016-07-21 11:25:23.991 Trying to open directory "/home/catalogger".
> 2016-07-21 11:25:23.991 Type: SSH_FXP_LSTAT, Size: 25, Number: 263
< 2016-07-21 11:25:23.991 Type: SSH_FXP_ATTRS, Size: 37, Number: 263
. 2016-07-21 11:25:23.991 Getting current directory name.
. 2016-07-21 11:25:23.991 Startup conversation with host finished.
< 2016-07-21 11:25:23.991 Script: Active session: [1] catalogger@10.12.3.1
> 2016-07-21 11:25:23.991 Script: get attema_cataloggerdata.txt D:\Guidance\Catalogger\Catalog\Update\ATT\ exit
. 2016-07-21 11:25:23.992 Listing file "attema_cataloggerdata.txt".
> 2016-07-21 11:25:23.992 Type: SSH_FXP_LSTAT, Size: 51, Number: 519
< 2016-07-21 11:25:23.993 Type: SSH_FXP_ATTRS, Size: 37, Number: 519
. 2016-07-21 11:25:23.993 attema_cataloggerdata.txt;-;211422;2016-07-21T05:12:04.000Z;"" [0];"" [0];rwxr-xr-x;0
. 2016-07-21 11:25:23.993 Listing file "D:\Guidance\Catalogger\Catalog\Update\ATT\".
> 2016-07-21 11:25:23.993 Type: SSH_FXP_LSTAT, Size: 68, Number: 775
< 2016-07-21 11:25:23.993 Type: SSH_FXP_STATUS, Size: 29, Number: 775
< 2016-07-21 11:25:23.993 Status code: 2, Message: 775, Server: No such file, Language:  
< 2016-07-21 11:25:23.994 Script: Can't get attributes of file 'D:\Guidance\Catalogger\Catalog\Update\ATT\'.
< 2016-07-21 11:25:23.994 Script: No such file or directory.
< 2016-07-21 11:25:23.994 Error code: 2
< 2016-07-21 11:25:23.994 Error message from server: No such file
. 2016-07-21 11:25:23.994 Script: Failed
. 2016-07-21 11:25:23.994 Script: Exit code: 1
. 2016-07-21 11:25:23.994 Closing connection.
. 2016-07-21 11:25:23.994 Sending special code: 12
. 2016-07-21 11:25:23.995 Sent EOF message

Reply with quote

Advertisement

MFrench
Joined:
Posts:
4
Location:
London

Hi,

I'm also facing the same problem trying to download files using c#.

I can connect to the FTP server, I can get the directory listing fine, when I ask to download one of the files, I get the error
Can't get attributes of file '/s685114.SLBSE766_20170203030427'. Could not retrieve file information Requested action aborted: local error in processing
This error happens either inputting a specific file name or just passing back to the code the first entry from the directory listing.

I've also setup the suggested Raw setting. Code:
sessionOptions.AddRawSettings("FtpUseMlsd", "1");
and I still get the same error.

When adding the wildcard * to the file name, it works fine.

Attaching the log generated here – I've replaced all the sensitive information like username, password, IP address and company name for the HOST of the FTP

Can you please take a look and let me know if I'm doing something wrong?

Thanks

Reply with quote

martin
Site Admin
martin avatar

@MFrench: Unless you can fix the server, appending the * to the filename is probably the best workaround. It makes WinSCP retrieve file data using a full directory listing (and filtering the files by the file mask), instead of using the SIZE and MDTM commands.

Reply with quote

MFrench
Joined:
Posts:
4
Location:
London

Thank you for checking. I was afraid that I was doing something wrong in the code.

Unfortunately it's not our server – it belongs to an external company.

I will keep the implementation with the wildcard search.

Reply with quote

arvy_p
Guest

I was running into the "can't get attributes" issue, and found that I could resolve it by setting FtpMode to FtpMode.Active in the SessionOptions. In Passive mode, the file info comes across an unpredictable port, but in Active, it's always port 20.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum