AnwarYagoub / RHCSA-RHCE-Lab-Environment

Lab environment for RHCSA/RHCE Cert Guide book by Sander van Vugt (not official)
https://anwaryagoub.github.io/RHCSA-RHCE-Lab-Environment/
77 stars 50 forks source link

set timezone based on geolocation error #5

Closed AnwarYagoub closed 7 years ago

AnwarYagoub commented 7 years ago

trying to set timezone using tzupdate results in the following error

Traceback (most recent call last):
  File "/bin/tzupdate", line 9, in <module>
    load_entry_point('tzupdate==0.5.0', 'console_scripts', 'tzupdate')()
  File "/usr/lib/python2.7/site-packages/tzupdate.py", line 151, in main
    timezone = get_timezone_for_ip(args.ip)
  File "/usr/lib/python2.7/site-packages/tzupdate.py", line 31, in get_timezone_for_ip
    api_response = requests.get(api_url).json()
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ip-api.com', port=80): Max retries exceeded with url: /json/ (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x174bdd0>: Failed to establish a new connection: [Errno 111] Connection refused',))

the service used to get geolocation from ip (ip-api.com) is not working.

smartbit commented 7 years ago

Fixed in #6 by adding a 15 seconds sleep. Because it now takes even longer, added async: 60. Verify timezone with ls -l /etc/localtime