vangorra / python_withings_api

Library for the Withings Health API
MIT License
101 stars 34 forks source link

Unexpected error fetching subscription_update_coordinator data: Error code 293 #71

Closed mkaatman closed 3 years ago

mkaatman commented 3 years ago

Trying to get the sleep monitor to work getting an invalid params exception error 293. I'm trying to track down the cause but I'm a bit lost.

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 658, in async_subscribe_webhook
    return await self._do_retry(self._async_subscribe_webhook)
  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 700, in _async_subscribe_webhook
    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 311, in notify_subscribe
    self.request(path=self.PATH_NOTIFY, params=params)
  File "/usr/local/lib/python3.9/site-packages/withings_api/__init__.py", line 78, in request
    return response_body_or_raise(
  File "/usr/local/lib/python3.9/site-packages/withings_api/common.py", line 825, in response_body_or_raise
    raise InvalidParamsException(status=status)
withings_api.common.InvalidParamsException: Error code 293
mkaatman commented 3 years ago

I got it. Here's how I tracked it down.

https://github.com/home-assistant/core/issues/46425#issuecomment-932828032

tl;dr: It wasn't a bug so much as a combination of withings only accepting ports 80 and 443, and hidden in a config file my callback url was set to 8123. Then I had to add my reverse proxy as a trusted source.