evetion / SpaceLiDAR.jl

A Julia package for working with ICESat-2 & GEDI data as part of my PhD research
https://www.evetion.nl/SpaceLiDAR.jl/dev/
GNU General Public License v3.0
23 stars 4 forks source link

HTTP/1.1 401 Unauthorized while requesting https://n5eil01u.ecs.nsidc.org .... #26

Closed alex-s-gardner closed 1 year ago

alex-s-gardner commented 1 year ago

Hi @evetion have you ever had an issue where the authentication just stops working. At first I thought it was an issue with Curl and that HTTP.download solved the problem but I was wrong.

SpaceLiDAR.download! was working great and then authentication stopped working

  1. My .netrc looks as expected
  2. I can download the file if I copy the url for the file into my browser so it's not a firewall issue

But neither SpaceLiDAR.download! nor HTTP.download will download from https://n5eil01u.ecs.nsidc.org

Here's the stack trace... doesn't show much except that the access request is Unauthorized

SpaceLiDAR.download!(granules[7455], atl06_dir) ERROR: HTTP/1.1 401 Unauthorized while requesting https://n5eil01u.ecs.nsidc.org/DP7/ATLAS/ATL06.005/2022.04.25/ATL06_20220425000438_05021511_005_02.h5 Stacktrace: [1] #3 @ /usr/local/julia-1.8.0/share/julia/stdlib/v1.8/Downloads/src/Downloads.jl:243 [inlined] [2] open(f::Downloads.var"#3#4"{Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Downloads.Downloader, String}, args::String; kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:write, :lock), Tuple{Bool, Bool}}}) @ Base ./io.jl:384 [3] #open_nolock#1 @ /usr/local/julia-1.8.0/share/julia/stdlib/v1.8/ArgTools/src/ArgTools.jl:35 [inlined] [4] arg_write(f::Function, arg::String) @ ArgTools /usr/local/julia-1.8.0/share/julia/stdlib/v1.8/ArgTools/src/ArgTools.jl:103 [5] #download#2 @ /usr/local/julia-1.8.0/share/julia/stdlib/v1.8/Downloads/src/Downloads.jl:230 [inlined] [6] _download(::String, ::Vararg{String}) @ SpaceLiDAR ~/.julia/packages/SpaceLiDAR/x5jZJ/src/granule.jl:14 [7] download!(granule::ICESat2_Granule{:ATL06}, folder::String) @ SpaceLiDAR ~/.julia/packages/SpaceLiDAR/x5jZJ/src/granule.jl:40 [8] top-level scope @ REPL[148]:1

evetion commented 1 year ago

Thanks for creating an issue.

I suspect it's something on the server that changed? What worked for me is deleting the line machine n5eil01u.ecs.nsidc.org in my .netrc, only the line for urs.earthdata.nasa.gov needs to be specified.

alex-s-gardner commented 1 year ago

So that worked for my MAC but my linux server throws a new error... digging into it.


ERROR: UndefVarError: easy_hooke not defined Stacktrace: [1] _download(::String, ::Vararg{String}) @ SpaceLiDAR ~/.julia/packages/SpaceLiDAR/x5jZJ/src/granule.jl:12 [2] download!(granule::ICESat2_Granule{:ATL06}, folder::String) @ SpaceLiDAR ~/.julia/packages/SpaceLiDAR/x5jZJ/src/granule.jl:39 [3] top-level scope @ ./REPL[2]:3

evetion commented 1 year ago

easy_hooke looks like a typo?

alex-s-gardner commented 1 year ago

Oh man... you're totally right. I looked at that for over an hour :-(

evetion commented 1 year ago

Fixed by #31

evetion commented 1 year ago

Also fixed externally: https://lpdaac.usgs.gov/news/401-error-when-passing-credentials-resolved/