Access denied (trying to access netcdf via matlab)

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
kuzminaso
Posts: 1
Joined: Mon Oct 16, 2023 4:44 pm America/New_York
Answers: 0

Access denied (trying to access netcdf via matlab)

by kuzminaso » Mon Oct 16, 2023 5:23 pm America/New_York

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)

Filters:

colleen
Posts: 135
Joined: Thu May 27, 2021 2:52 pm America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by colleen » Fri Oct 27, 2023 1:36 pm America/New_York

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

benedettobarone
Posts: 4
Joined: Mon May 08, 2023 6:09 pm America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by benedettobarone » Mon Nov 27, 2023 8:31 pm America/New_York

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.

javizavala
Posts: 3
Joined: Thu Jan 02, 2025 9:47 pm America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by javizavala » Thu Jan 02, 2025 10:06 pm America/New_York

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

adsf
Posts: 1
Joined: Fri Jan 03, 2025 10:44 am America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by adsf » Fri Jan 03, 2025 10:54 am America/New_York

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)

PODAAC - celiaoued
Subject Matter Expert
Subject Matter Expert
Posts: 46
Joined: Fri May 28, 2021 1:30 pm America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by PODAAC - celiaoued » Mon Jan 06, 2025 4:25 pm America/New_York

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

javizavala
Posts: 3
Joined: Thu Jan 02, 2025 9:47 pm America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by javizavala » Mon Jan 06, 2025 10:01 pm America/New_York

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

PODAAC - scosic
User Services
User Services
Posts: 7
Joined: Thu May 27, 2021 2:52 pm America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by PODAAC - scosic » Mon Feb 10, 2025 12:51 pm America/New_York

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

javizavala
Posts: 3
Joined: Thu Jan 02, 2025 9:47 pm America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by javizavala » Sat Feb 15, 2025 8:16 pm America/New_York

Thank you for your help!
Jvr

PODAAC - celiaoued
Subject Matter Expert
Subject Matter Expert
Posts: 46
Joined: Fri May 28, 2021 1:30 pm America/New_York
Answers: 0

Re: Access denied (trying to access netcdf via matlab)

by PODAAC - celiaoued » Tue Feb 25, 2025 7:50 pm America/New_York

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.

Post Reply