FTPClient.jl icon indicating copy to clipboard operation
FTPClient.jl copied to clipboard

Unable to use FTP client to download data

Open natgeo-wong opened this issue 5 years ago • 5 comments

Hello!

I am currently using FTPclient to try and download some data for the Precipitation Measurement Mission. However, the login username and password are emails, and I have this feeling that the @ signs in the emails are tripping everything up, because I keep getting the following error:

ERROR: Port must be numeric (decimal) Stacktrace: [1] parse_authority(::String, ::Bool) at /Users/natgeo-wong/.julia/packages/URIParser/Eg6Q9/src/parser.jl:132 [2] parse_url(::String) at /Users/natgeo-wong/.julia/packages/URIParser/Eg6Q9/src/parser.jl:294 [3] Type at /Users/natgeo-wong/.julia/packages/URIParser/Eg6Q9/src/parser.jl:298 [inlined] [4] #RequestOptions#6(::Bool, ::Bool, ::Type{RequestOptions}, ::String) at /Users/natgeo-wong/.julia/packages/FTPClient/5MZUK/src/request_options.jl:51 [5] Type at ./none:0 [inlined] [6] #FTP#18 at /Users/natgeo-wong/.julia/packages/FTPClient/5MZUK/src/FTPObject.jl:75 [inlined] [7] FTP(::String) at /Users/natgeo-wong/.julia/packages/FTPClient/5MZUK/src/FTPObject.jl:75 [8] top-level scope at none:0

I get the above errors when I try the following methods: FTP("ftp://[email protected]:[email protected]@arthurhou.pps.eosdis.nasa.gov") ftp = FTP("ftp://arthurhou.pps.eosdis.nasa.gov", [email protected],[email protected])

natgeo-wong avatar Sep 25 '19 21:09 natgeo-wong

Hi Nathaniel,

I can verify there's some weirdness with the extra @ symbol. Unfortunately the root cause is with with the package URIParser.jl.

The following code snippet results in the same error, except more directly.

import URIParser

URI("ftp://[email protected]:[email protected]@arthurhou.pps.eosdis.nasa.gov")

I've logged this issue for you, found here. Once this is resolved I'll update this package to use the version with the fix!

mattBrzezinski avatar Sep 25 '19 21:09 mattBrzezinski

Thank you so much for your help! I eagerly await to see what comes next!

I suppose I shall use MATLAB as a temporary fix xD.

natgeo-wong avatar Sep 25 '19 21:09 natgeo-wong

Possibly the solution might be the uriencode the username and password as such:

$ echo -n "[email protected]" | jq -s -R @uri
"natwongsedai%40outlook.com"

and then use that in the call such as

using URIParser

x = URI("ftp://natwongsedai%40outlook.com:natwongsedai%[email protected]")

fchorney avatar Sep 26 '19 14:09 fchorney

AHA THIS WORKS THANK YOUUUUUUUUU

natgeo-wong avatar Sep 26 '19 15:09 natgeo-wong

I'll leave this issue open as it's still a problem but there's a work around.

I commented on the URIParser issue with the work around incase anyone else comes across this problem.

mattBrzezinski avatar Sep 26 '19 15:09 mattBrzezinski