prakhar1989 / FoodTrucks

:truck: San Francisco's finger-licking street food now at your fingertips.
430 stars 419 forks source link

Using Google DNS server #18

Closed freeernest closed 4 years ago

freeernest commented 5 years ago

This pull request is coming to solve already reported issue: https://github.com/prakhar1989/FoodTrucks/issues/17

App.py failes to connect to http://data.sfgov.org/resource/rqzj-sfat.json and quits with error message

Traceback (most recent call last): File "app.py", line 121, in check_and_load_index() File "app.py", line 43, in check_and_load_index load_data_in_es() File "app.py", line 15, in load_data_in_es r = requests.get(url) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 69, in get return request('get', url, params=params, kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 50, in request response = session.request(method=method, url=url, kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 468, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 423, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='data.sfgov.org', port=80): Max retries exceeded with url: /resource/rqzj-sfat.json (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7ff546c74350>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

Now it succeeds to connect because I added dnsmasq package and put in it configuration file two Google DNS servers: nameserver 8.8.8.8 nameserver 8.8.4.4

Best Regards, Erik Feigin

prakhar1989 commented 4 years ago

hi, thanks for sending the PR and sorry for looking at the PR this late. The issue has been fixed (could be a temp issue with where the data is hosted). I want to keep the Dockerfile small so that it can be easy to grok for beginners, so I prefer not to add more commands to it if it works without it.

Thanks again for your PR!