Access denied (trying to access netcdf via matlab)
Access denied (trying to access netcdf via matlab)
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)
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)
Filters:
Re: Access denied (trying to access netcdf via matlab)
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
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
-
- Posts: 4
- Joined: Mon May 08, 2023 6:09 pm America/New_York
Re: Access denied (trying to access netcdf via matlab)
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.
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.
-
- Posts: 3
- Joined: Thu Jan 02, 2025 9:47 pm America/New_York
Re: Access denied (trying to access netcdf via matlab)
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
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)
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)
> 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)
-
- Subject Matter Expert
- Posts: 46
- Joined: Fri May 28, 2021 1:30 pm America/New_York
Re: Access denied (trying to access netcdf via matlab)
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
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
-
- Posts: 3
- Joined: Thu Jan 02, 2025 9:47 pm America/New_York
Re: Access denied (trying to access netcdf via matlab)
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
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
-
- User Services
- Posts: 7
- Joined: Thu May 27, 2021 2:52 pm America/New_York
Re: Access denied (trying to access netcdf via matlab)
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
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
-
- Posts: 3
- Joined: Thu Jan 02, 2025 9:47 pm America/New_York
-
- Subject Matter Expert
- Posts: 46
- Joined: Fri May 28, 2021 1:30 pm America/New_York
Re: Access denied (trying to access netcdf via matlab)
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.
For accessing the MUR SST file, I suggest removing the '.nc' from the end of the URL and trying that.