Closed acordill closed 4 years ago
And where is the rest of the log?
2019-09-18 00:17:08 ERROR (MainThread) [homeassistant.components.sensor] authenticated: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 441, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/authenticated/sensor.py", line 189, in update
for ipaddr in sorted(tokens, key=lambda x:tokens[x]['last_used_at'], reverse=True):
TypeError: '<' not supported between instances of 'str' and 'NoneType'
Having the same issue since HASS 0.99
me too after upgrade HA from 0.98.5 to 0.99.2
Upgrade HA to 0.100 but the problem persist.
2019-10-10 11:28:14 ERROR (MainThread) [homeassistant.components.sensor] authenticated: Error on device update! Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity await entity.async_device_update(warning=False) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 448, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/media/usb2/homeassistant/custom_components/authenticated/sensor.py", line 209, in update tokens, key=lambda x: tokens[x]["last_used_at"], reverse=True TypeError: '<' not supported between instances of 'str' and 'NoneType'
After upgrading to 0.100.2 I'm experiencing this issue as well, which was not present before upgrading from 0.99.X to my knowledge.
The error log is:
authenticated: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/authenticated/sensor.py", line 209, in update
tokens, key=lambda x: tokens[x]["last_used_at"], reverse=True
TypeError: '<' not supported between instances of 'str' and 'NoneType'
Exact same issue with exact same error in the log. On 0.99.2
Same issue with 99.3 and 100.3
Same issue with 100.2
Same issue with 100.3
Same issue.
Same issue with 101.3
This is weird... mine has not stopped working and is working now as well... I wonder what the issue is? This was updated 20 days ago - I assume y'all are running the latest one?
I assume y'all are running the latest one?
Version 1.2.0 according to HACS.
Also, the error references a specific bit of code in sensor.py at line 209 (tokens, key=lambda x: tokens[x]["last_used_at"], reverse=True
) which is the same as the version of sensor.py on github, so the error seem to match the latest version.
Honestly, I'm not sure how python's sorted
function works, but it's used in line 208 to sort the output of line 209. Line 209 seems to be extracting something with a key/value pair that contains "last_used_at"
. The error is saying it can't compare a string and NoneType. So it looks like one of the entries in the list (or dict, whatever) is correct and one is NoneType, causing the sort function to fail.
In line 168 it's pulling this data for the list from storage/auth.
When I look in my own auth file, I see an entry with "last_used_at": null,
in it.
If I had to guess, this is what's generating the error.
@ludeeus , does this seem correct? If so, is this a case that can be guarded against?
I have the same error, latest hass.io image (0.101.3) and latest authenticated (1.2.0):
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/authenticated/sensor.py", line 209, in update
tokens, key=lambda x: tokens[x]["last_used_at"], reverse=True
TypeError: '<' not supported between instances of 'NoneType' and 'str'
I have not been able to replicate it, not even with changing the auth file to have null values... https://github.com/custom-components/authenticated/releases/tag/1.2.1 have some more checks.
After updating to 1.2.1 the error is gone. Thanks!
Version of the custom_component
1.2.0 Describe the bug A clear and concise description of what the bug is. The sensor will not load log