Page 1 of 1

MERRA2 OpenDAP Download Failing

Posted: Tue Mar 21, 2023 3:58 pm America/New_York
by mlammers08atmos

I have been seeing recurring failures in an automated process trying to download MERRA2 data using pydap. It is failing on the pydap.cas.urs.setup_session step with hardcoded username/password:

session = setup_session(USERNAME, PASSWORD, check_url = "")

That throws this error:
"requests.exceptions.ConnectionError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f99efe9efa0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"

Please let me know what I need to update to get this process working again. It had been running without issue for multiple years and started failing a couple weeks ago. Thanks!

Re: MERRA2 OpenDAP Download Failing

Posted: Mon Mar 27, 2023 11:26 am America/New_York
by cbattisto

Can you please first verify that your Pydap version is >=3.2.1, and then run the following code?

from pydap.client import open_url
from pydap.cas.urs import setup_session

username = 'your_earthdata_username'
password = 'your_earthdata_password'

dataset_url = ''
session = setup_session(username, password, check_url=dataset_url)
dataset = open_url(dataset_url, session=session)

-Chris Battisto

Re: MERRA2 OpenDAP Download Failing

Posted: Wed Mar 29, 2023 4:27 pm America/New_York
by mlammers08atmos
Looks like the pydap version was outdated - thank you for posting the clarifying sample code.

Re: MERRA2 OpenDAP Download Failing

Posted: Thu Mar 30, 2023 11:49 am America/New_York
by cbattisto
You're welcome! For your reference, that example was pulled from this how-to at GES DISC: