SalishSeaCast / tools

Collection of tools for working with the SalishSeaCast MEOPAR NEMO model, its results, and associated data.
https://salishsea-meopar-tools.readthedocs.io/en/latest/index.html
Apache License 2.0
2 stars 4 forks source link

Download Weather Failing: Connection Error #19

Closed douglatornell closed 9 years ago

douglatornell commented 9 years ago

Original report by Susan Allen (Bitbucket: sea_susanallen, ).


#!python

2014-12-24 09:00:24 ERROR [download_weather] Traceback (most recent call last):
2014-12-24 09:00:24 ERROR [download_weather]   File "/data/dlatorne/MEOPAR/tools/SalishSeaTools/salishsea_tools/nowcast/workers/download_weather.py", line 78, in main
2014-12-24 09:00:24 ERROR [download_weather]     get_grib(parsed_args.forecast, config, checklist)
2014-12-24 09:00:24 ERROR [download_weather]   File "/data/dlatorne/MEOPAR/tools/SalishSeaTools/salishsea_tools/nowcast/workers/download_weather.py", line 141, in get_grib
2014-12-24 09:00:24 ERROR [download_weather]     fileURL, logger, filename, retry_time_limit=9000)
2014-12-24 09:00:24 ERROR [download_weather]   File "/data/dlatorne/MEOPAR/tools/SalishSeaTools/salishsea_tools/nowcast/lib.py", line 399, in get_web_data
2014-12-24 09:00:24 ERROR [download_weather]     response = requests.get(url, stream=filepath is not None)
2014-12-24 09:00:24 ERROR [download_weather]   File "/home/dlatorne/anaconda/envs/nowcast/lib/python2.7/site-packages/requests/api.py", line 60, in get
2014-12-24 09:00:24 ERROR [download_weather]     return request('get', url, **kwargs)
2014-12-24 09:00:24 ERROR [download_weather]   File "/home/dlatorne/anaconda/envs/nowcast/lib/python2.7/site-packages/requests/api.py", line 49, in request
2014-12-24 09:00:24 ERROR [download_weather]     return session.request(method=method, url=url, **kwargs)
2014-12-24 09:00:24 ERROR [download_weather]   File "/home/dlatorne/anaconda/envs/nowcast/lib/python2.7/site-packages/requests/sessions.py", line 457, in request
2014-12-24 09:00:24 ERROR [download_weather]     resp = self.send(prep, **send_kwargs)
2014-12-24 09:00:24 ERROR [download_weather]   File "/home/dlatorne/anaconda/envs/nowcast/lib/python2.7/site-packages/requests/sessions.py", line 569, in send
2014-12-24 09:00:24 ERROR [download_weather]     r = adapter.send(request, **kwargs)
2014-12-24 09:00:24 ERROR [download_weather]   File "/home/dlatorne/anaconda/envs/nowcast/lib/python2.7/site-packages/requests/adapters.py", line 407, in send
2014-12-24 09:00:24 ERROR [download_weather]     raise ConnectionError(err, request=request)
2014-12-24 09:00:24 ERROR [download_weather] ConnectionError: ('Connection aborted.', gaierror(-2, 'Name or service not known'))
douglatornell commented 9 years ago

Original comment by Doug Latornell (Bitbucket: douglatornell, GitHub: douglatornell).


gaierror is a DNS error, I think. The same issue caused the get_NeahBay_ssh worker to fail today.

Proposed resolution is to catch this exception and go into a re-try and back-off loop as is done for 404 errors.

douglatornell commented 9 years ago

Original comment by Doug Latornell (Bitbucket: douglatornell, GitHub: douglatornell).


Add exception handling for ConnectionError due to gaierror -2 re: issue #19.

douglatornell commented 9 years ago

Original comment by Doug Latornell (Bitbucket: douglatornell, GitHub: douglatornell).


Closing because the failure has not recurred in the 85 days since changeset b16175eb9986 was added, and there is no mention of gaierror in the past 7 days log files, so either the issue has not recurred, or the fix has been effective.