Page 1 of 1
Access denied (trying to access netcdf via matlab)
Posted: Mon Oct 16, 2023 5:23 pm America/New_York
by kuzminaso
Hey everyone!
I am trying to access the MUR SST files in the hyrax cloud via MatLab and only download a portion of the gridded file (these take up a lot of space).
Example of one of the links I'm trying to access:
https://opendap.earthdata.nasa.gov/providers/POCLOUD/collections/GHRSST%20Level%204%20MUR%20Global%20Foundation%20Sea%20Surface%20Temperature%20Analysis%20(v4.1)/granules/20201231090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc
When I try to access the link, I get an error message saying:
[The NetCDF library encountered an error during execution of 'open' function - 'Access failure
(-77)'.].
This means MatLab cannot access the cloud, because it needs a username and a password, right?
So, I have (I think, correctly) set up the .netrc file, as suggested in this tutorial:
https://opendap.github.io/documentation/tutorials/ClientAuthentication.html#_overview
This is how i have it set up, just in case:
machine opendap.earthdata.nasa.gov
login (mylogin)
password (mypassword)
machine earthdata.nasa.gov
login (mylogin)
password (mypassword)
But it seems that it didn't work for me. The tutorial also suggests creating a .dodsrc file, but I can't understand how that one works, to be honest. What is the cookie_file? Sorry, I'm very confused, because I really only code in MatLab on Windows.
Could anyone help me, if you have dealt with this issue?
P.S. when using the open access (no auth needed) file example they give in the MatLab tutorial, everything works splendid, so I know I am addressing the data correctly. (
https://opendap.github.io/documentation/tutorials/matlab_tutorial.html)
Re: Access denied (trying to access netcdf via matlab)
Posted: Fri Oct 27, 2023 1:36 pm America/New_York
by colleen
Thank you for your inquiry and I apologize for the delayed reply.
Your question has been forwarded to one of our subject matter experts, who is looking into your question and will get back to you as soon as possible.
Respectfully,
Colleen Schroeder
PO.DAAC User Services
Re: Access denied (trying to access netcdf via matlab)
Posted: Mon Nov 27, 2023 8:31 pm America/New_York
by benedettobarone
I reported this issue a few months ago in this thread:
viewtopic.php?t=4232
From the responses I received, I think it is a connection issue on the server side. I hope they can provide some additional details in response to your query.
Re: Access denied (trying to access netcdf via matlab)
Posted: Thu Jan 02, 2025 10:06 pm America/New_York
by javizavala
Hi, I am experiencing exactly the same problem posted here when trying to access opendap files using matlab. I followed all the steps in the tutorial, and I can read the file with no authentication required, but when I enter the file with authentication I get the error:
f='dap4://opendap.earthdata.nasa.gov/collections/C2036877806-POCLOUD/granules/20220812010000-OSISAF-L3C_GHRSST-SSTsubskin-GOES16-ssteqc_goes16_20220812_010000-v02.0-fv01.0';
ncid = netcdf.open(f);
Error using matlab.internal.imagesci.netcdflib
The NetCDF library encountered an error during execution of "open" function:
"Access failure (-77)".
Before doing this, I have created the ~/.netrc and ~/.dodsrc files as described in the tutorial, and I can access the file via a browser. Since this problem has been reported a couple of times (in this and another post), I wonder if there is some information missing in the tutorial.
Thanks for any help!
javier
Re: Access denied (trying to access netcdf via matlab)
Posted: Fri Jan 03, 2025 10:54 am America/New_York
by adsf
kuzminaso wrote:
> Hey everyone!
>
> I am trying to access the MUR SST files in the hyrax cloud via MatLab and
> only download a portion of the gridded file (these take up a lot of space).
> Example of one of the links I'm trying to access:
>
https://opendap.earthdata.nasa.gov/providers/POCLOUD/collections/GHRSST%20Level%204%20MUR%20Global%20Foundation%20Sea%20Surface%20Temperature%20Analysis%20(v4.1)/granules/20201231090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1.nc
>
> When I try to access the link, I get an error message saying:
> [The NetCDF library encountered an error during execution of 'open'
> function - 'Access failure
> (-77)'.].
> This means MatLab cannot access the cloud, because it needs a username and
> a password, right?
>
> So, I have (I think, correctly) set up the .netrc file, as suggested in
> this tutorial:
>
>
https://opendap.github.io/documentation/tutorials/ClientAuthentication.html#_overview
>
>
> This is how i have it set up, just in case:
> machine opendap.earthdata.nasa.gov
> login (mylogin)
> password (mypassword)
> machine earthdata.nasa.gov
> login (mylogin)
> password (mypassword)
>
> But it seems that it didn't work for me. The tutorial also suggests
> creating a .dodsrc file, but I can't understand how that one works, to be
> honest. What is the cookie_file? Sorry, I'm very confused, because I really
> only code in MatLab on Windows.
>
> Could anyone help me, if you have dealt with this issue?
>
> P.S. when using the open access (no auth needed) file example they give in
> the MatLab tutorial, everything works splendid, so I know I am addressing
> the data correctly.
> (
https://opendap.github.io/documentation/tutorials/matlab_tutorial.html)
Re: Access denied (trying to access netcdf via matlab)
Posted: Mon Jan 06, 2025 4:25 pm America/New_York
by PODAAC - celiaoued
Hello,
How about trying it with "machine urs.earthdata.nasa.gov", as described in the page below?
http://docs.opendap.org/index.php/DAP_Clients_-_Authentication#URS_&_LDAP
Re: Access denied (trying to access netcdf via matlab)
Posted: Mon Jan 06, 2025 10:01 pm America/New_York
by javizavala
Thanks PODAAC - celiaoued for answering.
As described in the tutorial, my ~/.netrc file has the lines:
machine urs.earthdata.nasa.gov
login (my_login email)
password (py_password)
and the last two lines of my ~/.dodsrc are:
HTTP.COOKIEJAR=/Users/zavalaga/.urs_cookies
HTTP.NETRC=/Users/zavalaga/.netrc
am I missing something?
Thanks for any help!
Jvr
Re: Access denied (trying to access netcdf via matlab)
Posted: Mon Feb 10, 2025 12:51 pm America/New_York
by PODAAC - scosic
Thank you for your inquiry and we apologize for the delayed reply.
Your question has been forwarded to one of our subject matter experts, who is looking into your question and will get back to you as soon as possible.
PO.DAAC team
Re: Access denied (trying to access netcdf via matlab)
Posted: Sat Feb 15, 2025 8:16 pm America/New_York
by javizavala
Thank you for your help!
Jvr
Re: Access denied (trying to access netcdf via matlab)
Posted: Tue Feb 25, 2025 7:50 pm America/New_York
by PODAAC - celiaoued
For @javizavala , have you also already edited the permissions on the .netrc file using chmod 600?
For accessing the MUR SST file, I suggest removing the '.nc' from the end of the URL and trying that.