ftpd icon indicating copy to clipboard operation
ftpd copied to clipboard

"550 Could not get file size" for particular folders

Open eku opened this issue 2 years ago • 5 comments

Describe the bug

I'm trying to backup the SD card in my switch via ftp. For this, as for other consoles, I use wget with the following command line

wget --mirror -c --no-host-directories --cut-dirs 0 --no-netrc --no-proxy --unlink --no-proxy --timeout=1 -P ftp://<IP of switch>:5000/ <local directory>

Some directories produce an FTP error, although I can very well access them via MTP. The consistency of the SD card was also checked.

To Reproduce Steps to reproduce the behavior:

  1. Use the wget commandline from above
USER anonymous
230 OK
SYST
215 UNIX Type: L8
PWD
257 "/"
TYPE I
200 OK
CWD /atmosphere
200 OK
SIZE automatic_backups
550 Could not get file size.
PASV
227 Entering Passive Mode (192,168,55,89,50,60)
RETR automatic_backups
450 failed to open file

Expected behavior All files and directories can be retrieved via ftp.

Screenshots

Platform (please complete the following information):

  • Switch 16.0.3. with Atmosphere

Additional context See also https://github.com/cathery/sys-ftpd/issues/26

For me it looks like the ftp daemon gets the type (file/directory) wrong for some directories.

eku avatar Jul 12 '23 10:07 eku

Is there anything I can do to speed up error analysis and rectification? Diagnostic data? Should I test something?

eku avatar Nov 17 '23 16:11 eku

Does automatic_backups have the archive bit set?

mtheall avatar Nov 20 '23 18:11 mtheall

Does automatic_backups have the archive bit set?

I don't know how to check this. NX-Shell does not show it. Neither do DBI and FTP. There is no other way available to me.

According to RFC959 there is no such thing as an "archive bit". The specification of the MTP protocol also says nothing about this.

Could you please explain the relationship between an archive bit and FTP? Which component should this set and why does the FTP server care?

eku avatar Nov 24 '23 16:11 eku

The archive bit is specific to FAT. The Switch's OS uses the archive bit to emulate files larger than 4GiB. As far as I'm aware, ftpd as a user application should see a directory with the archive bit set as if it were a file.

mtheall avatar Jan 09 '24 21:01 mtheall

As far as I'm aware, ftpd as a user application should see a directory with the archive bit set as if it were a file.

Thanks for the explanation. That really is a strange implementation.

Anyway, I ran the Fix archive bit function in Hekate and nothing has improved. Error in ftpd still exists. DBI does not show this error.

eku avatar Jan 10 '24 06:01 eku