I’m trying to scrape a local webapi with digest authentication but am receiving a error:
AttributeError: '_thread._local' object has no attribute 'pos'
When I remove user password authentication from the local webapi and removing it from the homeassistant scrape sensor it is working as expected.
How to debug?
/etc/homeassistant/configuration.yaml:
- platform: scrape
resource: "https://ubuntu-server.flissinger.local:8443/myappapi.html?part=status"
name: Myapp Test
username: !secret myapp_username
password: !secret myapp_password
authentication: digest
verify_ssl: False
select: "myapp status client[name='Myname'] connection"
/var/log/homeassistant.log:
2019-10-06 14:34:19 ERROR (MainThread) [homeassistant.components.sensor] scrape: Error on device update!
Traceback (most recent call last):
File "/home/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File "/home/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 441, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/lib/python3.6/site-packages/homeassistant/components/scrape/sensor.py", line 122, in update
self.rest.update()
File "/home/homeassistant/lib/python3.6/site-packages/homeassistant/components/rest/sensor.py", line 226, in update
self._request, timeout=self._timeout, verify=self._verify_ssl
File "/home/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 653, in send
r = dispatch_hook('response', hooks, r, **kwargs)
File "/home/homeassistant/lib/python3.6/site-packages/requests/hooks.py", line 31, in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
File "/home/homeassistant/lib/python3.6/site-packages/requests/auth.py", line 247, in handle_401
if self._thread_local.pos is not None:
AttributeError: '_thread._local' object has no attribute 'pos'