gamykla / security-cam

Home security camera image management api running on kubernetes
1 stars 0 forks source link

api.twitter.com dns resolution fails from pod #5

Closed gamykla closed 8 years ago

gamykla commented 8 years ago

DNS issue

Traceback (most recent call last):
  File "/security_cam/cam_server.py", line 33, in <module>
    response = requests.get('https://api.twitter.com')
  File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='api.twitter.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fdc41c71f10>: Failed to establish a new connection: [Errno -2] Name or service not known',))
gamykla commented 8 years ago

add a lookup to the pod to see what happens

Traceback (most recent call last):
  File "/security_cam/cam_server.py", line 33, in <module>
    print socket.gethostbyname('api.twitter.com')
  File "/usr/local/lib/python2.7/site-packages/gevent/_socketcommon.py", line 235, in gethostbyname
    return get_hub().resolver.gethostbyname(hostname)
  File "/usr/local/lib/python2.7/site-packages/gevent/resolver_thread.py", line 58, in gethostbyname
    return self.pool.apply(_socket.gethostbyname, args)
  File "/usr/local/lib/python2.7/site-packages/gevent/pool.py", line 300, in apply
    return self.spawn(func, *args, **kwds).get()
  File "/usr/local/lib/python2.7/site-packages/gevent/event.py", line 373, in get
    return self.get(block=False)
  File "/usr/local/lib/python2.7/site-packages/gevent/event.py", line 363, in get
    return self._raise_exception()
  File "/usr/local/lib/python2.7/site-packages/gevent/event.py", line 343, in _raise_exception
    reraise(*self.exc_info)
  File "/usr/local/lib/python2.7/site-packages/gevent/threadpool.py", line 207, in _worker
    value = func(*args, **kwargs)
gaierror: [Errno -3] Temporary failure in name resolution
gamykla commented 8 years ago

core@ip-10-0-1-91 ~ $ docker exec -it ee8aef73d071 /bin/bash

root@camserver-818956273-7wl3j:/etc# cat resolv.conf search default.svc.cluster.local svc.cluster.local cluster.local ec2.internal nameserver 10.3.0.10 options ndots:5

timeout: >>> s.connect(("10.3.0.10", 53))

gamykla commented 8 years ago

related to https://github.com/coreos/coreos-kubernetes/issues/707 possibly.

gamykla commented 8 years ago

fixed with newer kube