myTselection / MijnTuin

MijnTuin.org will STOP all activities in May 2024 and this integration will stop to function. MijnTuin.org Home Assistant custom component HACS to manage garden plants and see activities for your garden
MIT License
10 stars 1 forks source link

Timeout issues #12

Open vingerha opened 11 months ago

vingerha commented 11 months ago

Log output, this happens since max 2 weeks (not more details than this, sorry)


2023-11-07 15:25:35.142 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.mijn_tuin fails
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 462, in _make_request
httplib_response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/http/client.py", line 1378, in getresponse
response.begin()
File "/usr/local/lib/python3.11/http/client.py", line 318, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/http/client.py", line 279, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/socket.py", line 706, in readinto
return self._sock.recv_into(b)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/ssl.py", line 1311, in recv_into
return self.read(nbytes, buffer)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/ssl.py", line 1167, in read
return self._sslobj.read(len, buffer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 799, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 469, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 358, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='www.mijntuin.org', port=443): Read timed out. (read timeout=40)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 696, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 957, in async_device_update
await self.async_update()
File "/config/custom_components/mijntuin/sensor.py", line 173, in async_update
await self._data.update()
File "/config/custom_components/mijntuin/sensor.py", line 143, in update
await self._update()
File "/config/custom_components/mijntuin/sensor.py", line 133, in _update
await self._force_update()
File "/config/custom_components/mijntuin/sensor.py", line 121, in _force_update
self._calendarData = await self._hass.async_add_executor_job(lambda: self._session.getCalendar(self._plants))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mijntuin/sensor.py", line 121, in <lambda>
self._calendarData = await self._hass.async_add_executor_job(lambda: self._session.getCalendar(self._plants))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mijntuin/utils.py", line 186, in getCalendar
item['details'] = self.getTaskDetails(item.get('link'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mijntuin/utils.py", line 95, in getTaskDetails
response = self.s.get(tasklink,headers=header,cookies=self.cookies,timeout=40,allow_redirects=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 532, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='www.mijntuin.org', port=443): Read timed out. (read timeout=40)
vingerha commented 11 months ago

or... worse? it now added this


Logger: homeassistant.helpers.entity
Source: helpers/entity.py:696
First occurred: 17:26:05 (1 occurrences)
Last logged: 17:26:05

Update for sensor.mijn_tuin fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 696, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 957, in async_device_update
    await self.async_update()
  File "/config/custom_components/mijntuin/sensor.py", line 173, in async_update
    await self._data.update()
  File "/config/custom_components/mijntuin/sensor.py", line 143, in update
    await self._update()
  File "/config/custom_components/mijntuin/sensor.py", line 133, in _update
    await self._force_update()
  File "/config/custom_components/mijntuin/sensor.py", line 121, in _force_update
    self._calendarData = await self._hass.async_add_executor_job(lambda: self._session.getCalendar(self._plants))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mijntuin/sensor.py", line 121, in <lambda>
    self._calendarData = await self._hass.async_add_executor_job(lambda: self._session.getCalendar(self._plants))
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mijntuin/utils.py", line 186, in getCalendar
    item['details'] = self.getTaskDetails(item.get('link'))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mijntuin/utils.py", line 105, in getTaskDetails
    description = div_plantAction.find('div', {'class': 'description mt-3'})
                  ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'find'
myTselection commented 11 months ago

Can you still login on the website itself via browser? Might be general account issue..

vingerha commented 11 months ago

at the moment it works fine... and I hardly detect the error at the time it exposes itself so difficult to verify if the account is the cause