FTP instantiation fails due to PWD error

11 views (last 30 days)
SA
SA on 29 Aug 2023
Commented: SA on 6 Sep 2023
My RedHat machine (R2022b) cannot open ftp connections (including the example in matlab documentation). The error I get is:
Error using matlab.io.ftp.FTP
An internal error occurred during FTP operation "PWD": Could not match any server responses to the PWD command: HTTP/1.1 501 method notimplemented
Content-Type: text/html
Cache-Control: no-cache
X-Frame-Options: deny
Proxy-Connection: Keep-Alive
I haven't been able find any reference to this. This seems to indicate my client couldn't handle what came back from the server. It isn't the server (ftp.avl.class.noaa.gov) because I can connect using other machines / platforms / matlab version. Any ideas what could cause this? I believe matlab supplies its own ftp client.
I see a few class definitions in:
toolbox/matlab/io/ftp/+matlab/+io/@FTP
toolbox/matlab/io/ftp/+matlab/+io/+ftp/@FTP
In another machine (R2018b which works) I see a different toolbox organization:
toolbox/matlab/iofun/@ftp/ftp.m,
so the organization of the FTP interface has evolved in the last few years.
  3 Comments
SA
SA on 31 Aug 2023
Thanks for the reference. I just installed 2023a and the toolbox structure matches what you list, however I get the same error. The matlab ftp client must have a dependency that is incompatible on my machine.
It looks like ftp.m tests for a feature "FTPV2" and then if this exists, uses matlab.io.ftp.FTP, and if the feature is absent, uses matlab.io.internal.ftp.FTP. On my errant machine, the feature exists, so it is using the former class. I think I have found the problem. I'll have to dig some more to fix it.
SA
SA on 6 Sep 2023
The error above from toolbox/matlab/io/ftp/ftp.m is generated before any connection to a server is attempted. If anyone runs into this issue, my work around is to replace calls to ftp() with matlab.io.internal.ftp.FTP().

Sign in to comment.

Answers (0)

Categories

Find more on Install Products in Help Center and File Exchange

Tags

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!