DNS problem every day... My code every day have problems with connections to API
Sep 11 20:17:04 Exception in thread Thread-1 (run_schedule):
Sep 11 20:17:04 Traceback (most recent call last):
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
Sep 11 20:17:04 conn = connection.create_connection(
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection
Sep 11 20:17:04 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
Sep 11 20:17:04 File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
Sep 11 20:17:04 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Sep 11 20:17:04 socket.gaierror: [Errno -3] Temporary failure in name resolution
Sep 11 20:17:04 During handling of the above exception, another exception occurred:
Sep 11 20:17:04 Traceback (most recent call last):
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
Sep 11 20:17:04 httplib_response = self._make_request(
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 398, in _make_request
Sep 11 20:17:04 conn.request(method, url, **httplib_request_kw)
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 239, in request
Sep 11 20:17:04 super(HTTPConnection, self).request(method, url, body=body, headers=headers)
Sep 11 20:17:04 File "/usr/local/lib/python3.10/http/client.py", line 1282, in request
Sep 11 20:17:04 self._send_request(method, url, body, headers, encode_chunked)
Sep 11 20:17:04 File "/usr/local/lib/python3.10/http/client.py", line 1328, in _send_request
Sep 11 20:17:04 self.endheaders(body, encode_chunked=encode_chunked)
Sep 11 20:17:04 File "/usr/local/lib/python3.10/http/client.py", line 1277, in endheaders
Sep 11 20:17:04 self._send_output(message_body, encode_chunked=encode_chunked)
Sep 11 20:17:04 File "/usr/local/lib/python3.10/http/client.py", line 1037, in _send_output
Sep 11 20:17:04 self.send(msg)
Sep 11 20:17:04 File "/usr/local/lib/python3.10/http/client.py", line 975, in send
Sep 11 20:17:04 self.connect()
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 205, in connect
Sep 11 20:17:04 conn = self._new_conn()
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
Sep 11 20:17:04 raise NewConnectionError(
Sep 11 20:17:04 urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x79521fc225c0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
Sep 11 20:17:04 During handling of the above exception, another exception occurred:
Sep 11 20:17:04 Traceback (most recent call last):
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
Sep 11 20:17:04 resp = conn.urlopen(
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 785, in urlopen
Sep 11 20:17:04 retries = retries.increment(
Sep 11 20:17:04 File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
Sep 11 20:17:04 raise MaxRetryError(_pool, url, error or ResponseError(cause))
Sep 11 20:17:04 urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='alerts.com.ua', port=80): Max retries exceeded with url: /api/states/14 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x79521fc225c0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
Sep 11 20:17:04 During handling of the above exception, another exception occurred:
Sep 11 20:17:04 Traceback (most recent call last):
Sep 11 20:17:04 File "/home/intessencenibulon/bot/nibulon.py", line 46, in execute_task
Sep 11 20:17:05 response = requests.get(url, headers=headers)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
Sep 11 20:17:05 return request("get", url, params=params, **kwargs)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
Sep 11 20:17:05 return session.request(method=method, url=url, **kwargs)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
Sep 11 20:17:05 resp = self.send(prep, **send_kwargs)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
Sep 11 20:17:05 r = adapter.send(request, **kwargs)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 565, in send
Sep 11 20:17:05 raise ConnectionError(e, request=request)
Sep 11 20:17:05 requests.exceptions.ConnectionError: HTTPConnectionPool(host='alerts.com.ua', port=80): Max retries exceeded with url: /api/states/14 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x79521fc225c0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
Sep 11 20:17:05 During handling of the above exception, another exception occurred:
Sep 11 20:17:05 Traceback (most recent call last):
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
Sep 11 20:17:05 conn = connection.create_connection(
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection
Sep 11 20:17:05 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
Sep 11 20:17:05 File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
Sep 11 20:17:05 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Sep 11 20:17:05 socket.gaierror: [Errno -3] Temporary failure in name resolution
Sep 11 20:17:05 During handling of the above exception, another exception occurred:
Sep 11 20:17:05 Traceback (most recent call last):
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
Sep 11 20:17:05 httplib_response = self._make_request(
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
Sep 11 20:17:05 self._validate_conn(conn)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
Sep 11 20:17:05 conn.connect()
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect
Sep 11 20:17:05 self.sock = conn = self._new_conn()
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
Sep 11 20:17:05 raise NewConnectionError(
Sep 11 20:17:05 urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x79521fc224a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
Sep 11 20:17:05 During handling of the above exception, another exception occurred:
Sep 11 20:17:05 Traceback (most recent call last):
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
Sep 11 20:17:05 resp = conn.urlopen(
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 785, in urlopen
Sep 11 20:17:05 retries = retries.increment(
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
Sep 11 20:17:05 raise MaxRetryError(_pool, url, error or ResponseError(cause))
Sep 11 20:17:05 urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url:*******1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x79521fc224a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
Sep 11 20:17:05 During handling of the above exception, another exception occurred:
Sep 11 20:17:05 Traceback (most recent call last):
Sep 11 20:17:05 File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
Sep 11 20:17:05 self.run()
Sep 11 20:17:05 File "/usr/local/lib/python3.10/threading.py", line 953, in run
Sep 11 20:17:05 self._target(*self._args, **self._kwargs)
Sep 11 20:17:05 File "/home/intessencenibulon/bot/nibulon.py", line 78, in run_schedule
Sep 11 20:17:05 schedule.run_pending()
Sep 11 20:17:05 File "/home/intessencenibulon/.local/lib/python3.10/site-packages/schedule/__init__.py", line 822, in run_pending
Sep 11 20:17:05 default_scheduler.run_pending()
Sep 11 20:17:05 File "/home/intessencenibulon/.local/lib/python3.10/site-packages/schedule/__init__.py", line 100, in run_pending
Sep 11 20:17:05 self._run_job(job)
Sep 11 20:17:05 File "/home/intessencenibulon/.local/lib/python3.10/site-packages/schedule/__init__.py", line 172, in _run_job
Sep 11 20:17:05 ret = job.run()
Sep 11 20:17:05 File "/home/intessencenibulon/.local/lib/python3.10/site-packages/schedule/__init__.py", line 693, in run
Sep 11 20:17:05 ret = self.job_func()
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/retrying.py", line 49, in wrapped_f
Sep 11 20:17:05 return Retrying(*dargs, **dkw).call(f, *args, **kw)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/retrying.py", line 212, in call
Sep 11 20:17:05 raise attempt.get()
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/retrying.py", line 247, in get
Sep 11 20:17:05 six.reraise(self.value[0], self.value[1], self.value[2])
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/six.py", line 719, in reraise
Sep 11 20:17:05 raise value
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/retrying.py", line 200, in call
Sep 11 20:17:05 attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
Sep 11 20:17:05 File "/home/intessencenibulon/bot/nibulon.py", line 70, in execute_task
Sep 11 20:17:05 bot.send_message('******")
Sep 11 20:17:05 File "/home/intessencenibulon/.local/lib/python3.10/site-packages/telebot/__init__.py", line 1549, in send_message
Sep 11 20:17:05 apihelper.send_message(
Sep 11 20:17:05 File "/home/intessencenibulon/.local/lib/python3.10/site-packages/telebot/apihelper.py", line 264, in send_message
Sep 11 20:17:05 return _make_request(token, method_url, params=payload, method='post')
Sep 11 20:17:05 File "/home/intessencenibulon/.local/lib/python3.10/site-packages/telebot/apihelper.py", line 156, in _make_request
Sep 11 20:17:05 result = _get_req_session().request(
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
Sep 11 20:17:05 resp = self.send(prep, **send_kwargs)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
Sep 11 20:17:05 r = adapter.send(request, **kwargs)
Sep 11 20:17:05 File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 565, in send
Sep 11 20:17:05 raise ConnectionError(e, request=request)
Sep 11 20:17:05 requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot*******/sendMessage?chat_id=******F%21 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x79521fc224a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))