MadPatrick / somfy

Tahoma/Conexoon plugin for IO blinds, this plugin require internet connexion and a Somfy account
GNU General Public License v3.0
14 stars 3 forks source link

No internet acces : many error lines in log #42

Closed jcbraem closed 1 year ago

jcbraem commented 1 year ago

Hello,

When the internet connection is down we have many line in error log. I have every day one reset of my internet connexion (poor ADSL with ~4mb but linked with LTE) and 2 minutes of down.

It's possible to use one 'timemout' before to avoid theses errors ? It is my last error with your plugin and Connexoon due to your beautifull recents corrections :)

Thanks,

Jean-Charles

Domoticz log :


2023-01-10 00:01:48.818 Error: Météo: Error connecting to Server...
2023-01-10 00:01:49.899 Error: Météo: Error connecting to Server...
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: Traceback (most recent call last):
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: conn = connection.create_connection(
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: socket.gaierror: [Errno -3] Temporary failure in name resolution
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: During handling of the above exception, another exception occurred:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: Traceback (most recent call last):
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: httplib_response = self._make_request(
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: self._validate_conn(conn)
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: conn.connect()
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 353, in connect
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: conn = self._new_conn()
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 181, in _new_conn
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: raise NewConnectionError(
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f2b88578970>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: During handling of the above exception, another exception occurred:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: Traceback (most recent call last):
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: resp = conn.urlopen(
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: retries = retries.increment(
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: raise MaxRetryError(_pool, url, error or ResponseError(cause))
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='tahomalink.com', port=443): Max retries exceeded with url: /enduser-mobile-web/enduserAPI/authenticated (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f2b88578970>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: During handling of the above exception, another exception occurred:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux:
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: Traceback (most recent call last):
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/plugin.py", line 597, in onHeartbeat
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: _plugin.onHeartbeat()
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/plugin.py", line 302, in onHeartbeat
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: if self.local or (self.tahoma.logged_in and not self.tahoma.startup):
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/tahoma.py", line 48, in logged_in
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: self.__logged_in = self.get_login()
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/tahoma.py", line 55, in get_login
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: response = requests.get(url, headers=Headers, timeout=self.timeout)
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/api.py", line 76, in get
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: return request('get', url, params=params, **kwargs)
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: return session.request(method=method, url=url, **kwargs)
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: resp = self.send(prep, **send_kwargs)
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: r = adapter.send(request, **kwargs)
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: raise ConnectionError(e, request=request)
2023-01-10 00:01:50.611 Error: Connexoon Somfy Vélux: requests.exceptions.ConnectionError: HTTPSConnectionPool(host='tahomalink.com', port=443): Max retries exceeded with url: /enduser-mobile-web/enduserAPI/authenticated (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f2b88578970>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))```
JanJaapKo commented 1 year ago

Ok, can you give it a try with v4.2.10? Can'make the error go away, at least there should be only 1 error line

jcbraem commented 1 year ago

v4.2.10 Running. Result tomorrow.

Thank again for your quick action.

jcbraem commented 1 year ago

Hello,

Sorry but with v4.2.10 I have always lot of log information in Domoticz for one Internet down.

Log Somfy: (cleaned) somfy.log

Log Domoticz :


2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: Traceback (most recent call last):
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: conn = connection.create_connection(
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: socket.gaierror: [Errno -3] Temporary failure in name resolution
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: During handling of the above exception, another exception occurred:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: Traceback (most recent call last):
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: httplib_response = self._make_request(
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: self._validate_conn(conn)
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: conn.connect()
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 353, in connect
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: conn = self._new_conn()
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 181, in _new_conn
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: raise NewConnectionError(
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f0a9c7e52b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: During handling of the above exception, another exception occurred:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: Traceback (most recent call last):
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: resp = conn.urlopen(
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: retries = retries.increment(
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: raise MaxRetryError(_pool, url, error or ResponseError(cause))
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='tahomalink.com', port=443): Max retries exceeded with url: /enduser-mobile-web/enduserAPI/authenticated (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f0a9c7e52b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: During handling of the above exception, another exception occurred:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux:
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: Traceback (most recent call last):
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/plugin.py", line 598, in onHeartbeat
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: _plugin.onHeartbeat()
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/plugin.py", line 300, in onHeartbeat
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: if self.local or (self.tahoma.logged_in and not self.tahoma.startup):
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/tahoma.py", line 48, in logged_in
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: self.__logged_in = self.get_login()
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/tahoma.py", line 55, in get_login
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: response = requests.get(url, headers=Headers, timeout=self.timeout)
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/api.py", line 76, in get
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: return request('get', url, params=params, **kwargs)
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: return session.request(method=method, url=url, **kwargs)
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: resp = self.send(prep, **send_kwargs)
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: r = adapter.send(request, **kwargs)
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: raise ConnectionError(e, request=request)
2023-01-11 23:59:36.745 Error: Connexoon Somfy Vélux: requests.exceptions.ConnectionError: HTTPSConnectionPool(host='tahomalink.com', port=443): Max retries exceeded with url: /enduser-mobile-web/enduserAPI/authenticated (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f0a9c7e52b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))```
JanJaapKo commented 1 year ago

OK, think I got it. I only protected the actual fetching of the update data but before that we check if we are logged in, which was not protected. Included in v4.2.11

jcbraem commented 1 year ago

Hello, Nice update, only two error lines in log. Thanks for your job.

Jean-Charles

2023-01-13 23:57:41.236 Error: Connexoon Somfy Vélux: Failed to contact server: HTTPSConnectionPool(host='tahomalink.com', port=443): Max retries exceeded with url: /enduser-mobile-web/enduserAPI/authenticated (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f42cc68aee0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) 2023-01-13 23:57:53.522 Error: Connexoon Somfy Vélux: Failed to request data: HTTPSConnectionPool(host='tahomalink.com', port=443): Max retries exceeded with url: /enduser-mobile-web/enduserAPI/login (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f42cc68a160>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

JanJaapKo commented 1 year ago

ok, you're welcome!