Page 1 of 1

Python script DAACDataDownload authentication isse

Posted: Tue Mar 14, 2023 12:29 pm America/New_York
by fcarneiro
response.status_code=401

Error message: Verify that your username and password are correct in C:\Users\fernando.carneiro/.netrc

I already verified my username and password and both are working fine for the link that I am trying to download the file.

It is popping this warning as well, which I have no idea if it is related with the authentication issue

Warning: InsecureRequestWarning: Unverified HTTPS request is being made to host 'urs.earthdata.nasa.gov'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(

Re: Python script DAACDataDownload authentication isse

Posted: Tue Mar 14, 2023 2:45 pm America/New_York
by PODAAC - jmcnelis
HI,

Please make sure that your local netrc file is configured following these instructions: https://github.com/podaac/data-subscriber#step-2-setup-your-earthdata-login

I think your issue is the filename. Try '_netrc' instead if you're on Windows.

Thanks,
Jack @ PODAAC

Re: Python script DAACDataDownload authentication isse

Posted: Tue Mar 14, 2023 3:09 pm America/New_York
by fcarneiro
You are right I am using windows, but I am still getting the same error when I rename .netrc to _netrc

When I print(netrc(netrcDir).authenticators(urs)[0]) and print(netrc(netrcDir).authenticators(urs)[2]) information matches with my username and password

URL example: https://opendap.earthdata.nasa.gov/providers/POCLOUD/collections/ECCO%20Atmosphere%20Surface%20Temperature%2C%20Humidity%2C%20Wind%2C%20and%20Pressure%20-%20Daily%20Mean%200.5%20Degree%20(Version%204%20Release%204)/granules/ATM_SURFACE_TEMP_HUM_WIND_PRES_day_mean_2000-03-17_ECCO_V4r4_latlon_0p50deg.ascii

Warning and Error message:
C:\Users\fernando.carneiro\Documents\python_env\data_download\lib\site-packages\urllib3\connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host 'urs.earthdata.nasa.gov'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(
ATM_SURFACE_TEMP_HUM_WIND_PRES_day_mean_2000-03-18_ECCO_V4r4_latlon_0p50deg.ascii not downloaded. Verify that your username and password are correct in C:\Users\fernando.carneiro/_netrc

Re: Python script DAACDataDownload authentication isse

Posted: Tue Mar 14, 2023 5:10 pm America/New_York
by PODAAC - jmcnelis
Hi again,

Sorry, I did not realize that you are using OPeNDAP. There may be additional steps required.

First, can you please point me to the script you are running? Is it on github?

Thanks for your patience,
Jack

Re: Python script DAACDataDownload authentication isse

Posted: Wed Mar 15, 2023 8:57 am America/New_York
by fcarneiro
Hi Jack,

First of all, thanks for your support very much appreciated.

Here is the script location that I am using https://git.earthdata.nasa.gov/projects/LPDUR/repos/daac_data_download_python/browse/DAACDataDownload.py

Let me know if you need any additional information.

Fernando