Closed bckthomas closed 6 months ago
I have the same error in the logs concerning the webhook subscriptionand all my strava.sensors remain unavailable even after a restart. Same configuration : Core 2024.4.2 Supervisor 2024.04.0 Operating System 12.1 Strava 3.2.32
Hi @jacme31 , @bckthomas
I have not been able to replicate this issue locally.
Are you able to
?
Thank you
Hi @craibo Here is the log error:
2024-04-10 08:33:32.114 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Strava for ha_strava
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 724, in async_unload
result = await component.async_unload_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha_strava/__init__.py", line 867, in async_unload_entry
remove_listener()
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 844, in <lambda>
return lambda: self.update_listeners.remove(listener)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: list.remove(x): x not in list
In my case, I found out the reason for the problem. The "homeassistant external URL" setting (Settings > System > Network) was incorrect. (I had positioned port 8123 even though I use a reverse proxy and internet communication is done on port 443). What is strange is that this configuration error is very old and had not caused any problem before the latest updates of HA core and Strava. After correction STRAVA Integration works perfectly and sorry for the inconvenience.
For information and if it helps I had the same log as @bckthomas when reloading the integration. On the other hand, when restarting Home Assistant I found this error in the logs
Traceback (most recent call last):
File "/config/custom_components/ha_strava/__init__.py", line 781, in strava_startup_functions
await renew_webhook_subscription(
File "/config/custom_components/ha_strava/__init__.py", line 630, in renew_webhook_subscription
callback_response = await websession.get(url=config_data[CONF_CALLBACK_URL])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1235, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1000, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host HAhost.mydomain.fr:8123 ssl:default [Connect call failed ('99.99.99.99', 8123)]
Thanks @jacme31, glad its working for you. That would explain the other issues you saw similar to @bckthomas's
@bckthomas I believe the errors you have shared are a result of the original webhook listener setup failing. There should be another error similar to @jacme31's one pointing us in the right direction to solve this.
Hi everyone
I think the external url is correctly configured for me
Can anyone give me a lead on how to investigate the original webhook listener?
Hi @craibo, @jacme31
In core.config_entries file, the callback_url is "https://homeassistant.xxx.fr/api/strava/webhook". is this good or should it be my.home-assistant.io ?
Hi @bckthomas
The url looks correct.
Can you please:
EDIT:
Hi
This is the error in log
2024-04-12 09:02:56.804 ERROR (MainThread) [custom_components.ha_strava] Expected 1 webhook subscription for https://homeassistant.xxx.fr/api/strava/webhook; found: 0
Hi
I get this error in the logs when Strava wants to update : Expected 1 webhook subscription for https://homeassistant.xxx.fr/api/strava/webhook; found: 0
The callback is configured with the correct domain :
On restart, despite this error, my last activity is displayed in sensor.strava_0_0 Unexpected response (status code: 400) while creating Strava Webhook Subscription: {"message":"Bad Request","errors":[{"resource":"PushSubscription","field":"callback url","code":"GET to callback URL does not return 200"}]}
Strava 3.2.32 Core 2024.4.2 Supervisor 2024.04.0 Operating System 12.1