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

Very long error log "urllib3.exceptions.ReadTimeoutError" #44

Closed jcbraem closed 1 year ago

jcbraem commented 1 year ago

Hello,

I have one error with an very long log. I don't have instructions to reproduce this error (only 1 or 2 by day). Currently I have an frequency of 1 minute for web refresh of an Connexoon box.

I see '10' for this timeout. It is hardcoded value, in second ? For the Internet down we have now a small log. It is possible to have the same 'small' informations in Domoticz for this issue ?

Thank-you,

Jean-Charles

somfy.log

2023-01-17 01:19:04.217 Error: Connexoon Somfy Vélux: Call to function 'onHeartbeat' failed, exception details: 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: Traceback (most recent call last): 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: self._validate_conn(conn) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: conn.connect() 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 411, in connect 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: self.sock = ssl_wrapsocket( 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/util/ssl.py", line 449, in ssl_wrap_socket 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: ssl_sock = _ssl_wrap_socketimpl( 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/util/ssl.py", line 493, in _ssl_wrap_socket_impl 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: return ssl_context.wrap_socket(sock, server_hostname=server_hostname) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: return self.sslsocket_class._create( 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3.9/ssl.py", line 1040, in _create 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: self.do_handshake() 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: self._sslobj.do_handshake() 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: socket.timeout: _ssl.c:1106: The handshake operation timed out 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: During handling of the above exception, another exception occurred: 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: Traceback (most recent call last): 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: resp = conn.urlopen( 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: retries = retries.increment( 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 532, in increment 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: raise six.reraise(type(error), error, _stacktrace) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/six.py", line 719, in reraise 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: raise value 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: httplib_response = self._make_request( 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 385, in _make_request 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 336, in _raise_timeout 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: raise ReadTimeoutError( 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='tahomalink.com', port=443): Read timed out. (read timeout=10) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: During handling of the above exception, another exception occurred: 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: Traceback (most recent call last): 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/plugin.py", line 598, in onHeartbeat 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: _plugin.onHeartbeat() 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/plugin.py", line 300, in onHeartbeat 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: if self.local or (self.tahoma.logged_in and not self.tahoma.startup): 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/tahoma.py", line 48, in logged_in 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: self.__logged_in = self.get_login() 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/home/jcb/domoticz/plugins/somfy/tahoma.py", line 56, in get_login 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: response = requests.get(url, headers=Headers, timeout=self.timeout) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/api.py", line 76, in get 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: return request('get', url, params=params, kwargs) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: return session.request(method=method, url=url, kwargs) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: resp = self.send(prep, send_kwargs) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: r = adapter.send(request, kwargs) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: File "/usr/lib/python3/dist-packages/requests/adapters.py", line 529, in send 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: raise ReadTimeout(e, request=request) 2023-01-17 01:19:04.290 Error: Connexoon Somfy Vélux: requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='tahomalink.com', port=443): Read timed out. (read timeout=10)

JanJaapKo commented 1 year ago

OK sure. I had a catch on that one in getting events (the time out specifies how long the plugin waits when getting data back from the server). I added it now to the get_devices as well.

And pruned the loglines a bit more.

It is in v4.2.13

jcbraem commented 1 year ago

Thank-you. v4.2.13 is running now. See into a couple of days.

About the timeout value 10 it is in seconds ? It is possible to change this in parameter ?

JanJaapKo commented 1 year ago

It should not be necessary to change it. Setting it too long will block other actions in the framework during this timeout period so that is not wanted. Too short will lead to timing out too often, also not wanted. From experience, the 10 seconds works quite well.

jcbraem commented 1 year ago

I think this issue solved in Web mode. But probably not used in future because local mode is actived ;)