Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected error fetching poll_data_update_coordinator data: 'dict' object has no attribute 'context' #72

Open
mkaatman opened this issue Oct 3, 2021 · 1 comment

Comments

@mkaatman
Copy link

mkaatman commented Oct 3, 2021

Logger: homeassistant.components.withings
Source: components/withings/common.py:747
Integration: Withings (documentation, issues)
First occurred: 3:12:23 AM (1 occurrences)
Last logged: 3:12:23 AM

Unexpected error fetching poll_data_update_coordinator data: 'dict' object has no attribute 'context'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 730, in async_get_all_data
    return await self._do_retry(self._async_get_all_data)
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 654, in _do_retry
    raise exception
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 647, in _do_retry
    return await func()
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 766, in _async_get_all_data
    **await self.async_get_measures(),
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 776, in async_get_measures
    response = await self._hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/withings_api/__init__.py", line 161, in measure_get_meas
    **self.request(path=self.PATH_MEASURE, params=params)
  File "/usr/local/lib/python3.9/site-packages/withings_api/__init__.py", line 81, in request
    return response_body_or_raise(
  File "/usr/local/lib/python3.9/site-packages/withings_api/common.py", line 823, in response_body_or_raise
    raise AuthFailedException(status=status)
withings_api.common.AuthFailedException: Error code 401

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 743, in async_get_all_data
    flow = next(
  File "/usr/src/homeassistant/homeassistant/components/withings/common.py", line 747, in <genexpr>
    if flow.context == context
AttributeError: 'dict' object has no attribute 'context'

@Flameeyes
Copy link

FWIW I think I have the fix for this in https://github.com/flameeyes/core/tree/withings-fixes — but I have not sent a pull request upstream because I need to fix the tests and was waiting to help a friend with a different issue that is still not fixed, first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants