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

SRTM endpoint timeout #45

Open
jtpio opened this issue Sep 30, 2019 · 3 comments
Open

SRTM endpoint timeout #45

jtpio opened this issue Sep 30, 2019 · 3 comments

Comments

@jtpio
Copy link

jtpio commented Sep 30, 2019

It looks like the SRTM endpoints are down or not reachable anymore:

http://dds.cr.usgs.gov/srtm/version2_1/SRTM1/

Getting the following error:

/srv/conda/envs/notebook/lib/python3.7/site-packages/srtm/data.py in retrieve_or_load_file_data(self, file_name)
    143             r = mod_requests.get(url, timeout=5)
    144         except mod_requests.exceptions.Timeout:
--> 145             raise Exception('Connection to %s failed (timeout)' % url)
    146         if r.status_code < 200 or 300 <= r.status_code:
    147             raise Exception('Cannot retrieve %s' % url)

Exception: Connection to http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N42E011.hgt.zip failed (timeout)
@tkrajina
Copy link
Owner

tkrajina commented Sep 30, 2019

It's working now. But, I'm aware (and everybody else should be) that this can happen any time. Unfortunately there is no simple solution.

@jtpio
Copy link
Author

jtpio commented Sep 30, 2019

The links seem to be back, but I'm still seeing the issue when using strm.py.

Could it be that the timeout is a little bit tight? (5 seconds):

r = mod_requests.get(url, timeout=5)

@tkrajina tkrajina reopened this Sep 30, 2019
@tkrajina
Copy link
Owner

tkrajina commented Sep 30, 2019

Hm, try to increase it and see ifit works. If you want to make a pull request to make the timeout configurable (with 5s default fallback), I can merge it.

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

No branches or pull requests

2 participants