Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection Issues #4

Open
cmarshak opened this issue Mar 20, 2020 · 6 comments
Open

Connection Issues #4

cmarshak opened this issue Mar 20, 2020 · 6 comments

Comments

@cmarshak
Copy link

cmarshak commented Mar 20, 2020

For the notebook provided, I am currently getting the following error quite frequently and cannot easily make get requests:

ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

I get this when running the cell:

# Query service capability URL 

from xml.etree import ElementTree as ET

capability_url = f'https://n5eil02u.ecs.nsidc.org/egi/capabilities/{short_name}.{latest_version}.xml'

print(capability_url)
# Create session to store cookie and pass credentials to capabilities url

session = requests.session()
s = session.get(capability_url)
response = session.get(s.url,auth=(uid,pswd))

root = ET.fromstring(response.content)

Is this a maintenance issues? Or working remotely away from a NASA facility?

Hope you are all taking good care during these trying and scary times.

@betolink
Copy link
Member

betolink commented Mar 20, 2020

@cmarshak I tried to reproduce the error but I couldn't. If you ran the requests on a Wednesday chances are that it was a maintenance issue. NSIDC does that every Wednesday morning and some services get degraded. The URL should be accessible from anywhere as long as you enter valid EarthData login credentials.

@cmarshak
Copy link
Author

cmarshak commented Mar 20, 2020

When I run the code through my JPL VPN, I do not have the issue. It's when I run the code through my home network.

Because I am downloading a lot of data, I am trying to avoid routing any requests through a VPN.

Thank you again for your help.

@ghost
Copy link

ghost commented Mar 24, 2020

@cmarshak: I'm Lisa with NSIDC User Services. I'm working with our Data Operations and System Administrators to troubleshoot your issue. I'll let you know when I have more information.

@cmarshak
Copy link
Author

cmarshak commented Mar 26, 2020

Thank you! I am currently able to use a JPL server so I am not dealing with these problems.

As an aside, I have found that the session from the notebook are no longer working.

I had to replace session objects with those I found from here.

Specifically:

class SessionWithHeaderRedirection(requests.Session):
    AUTH_HOST = 'urs.earthdata.nasa.gov'
    def __init__(self, username, password):
 
        super().__init__()
 
        self.auth = (username, password)
 
    def rebuild_auth(self, prepared_request, response):
        headers = prepared_request.headers
        url = prepared_request.url
        if 'Authorization' in headers:
            original_parsed = requests.utils.urlparse(response.request.url)
            redirect_parsed = requests.utils.urlparse(url)
            if (original_parsed.hostname != redirect_parsed.hostname) and \
                    redirect_parsed.hostname != self.AUTH_HOST and \
                    original_parsed.hostname != self.AUTH_HOST:
                 del headers['Authorization']

        return

@ghost
Copy link

ghost commented Apr 1, 2020

@cmarshak I apologize for the delay in getting back to you. We appreciate that you brought the Earthdata code snippet to our attention and we’re looking into incorporating it.

To help us troubleshoot further, could you do the following:

  1. Provide us with your code so we can see how you're doing the multi threading?
  2. Could you attempt another download and give us the time you did that so we can look through the logs?

@asteiker
Copy link
Member

asteiker commented Jan 23, 2024

CRYO-29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants