Closed wvdb0 closed 3 months ago
Hey there @joostlek, mind taking a look at this issue as it has been labeled with an integration (withings
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
withings documentation withings source (message by IssueLinks)
Can you try to regenerate the client id and client secret at Withings?
Can you try to regenerate the client id and client secret at Withings?
I made a new client in the developer portal. I removed the previous integration data, removed the credential. re added the new data but still no luck.
Looks like every request keeps timing out. Are you blocking withings in any way?
no blocking, it suddenly appeared months ago. the withings app works as it should.
an update: I rechecked and I see Registered URLs
Register the URLs you will be using for the OAuth2 services and data notification services.
Our servers couldn't reach this URL: https://my.home-assistant.io/redirect/oauth
Partner error: Host Unreachable Click here to learn more
where did you see that? You should not click check URL when entering application details
it was when I revisited the details on the developer portal.
Yes, you should not click the recheck link button
But looking at you logs, every request towards withings is timing out
that is the weird thing, there is nothing in my network blocking withings. All other connections work perfectly. It is only this one that is driving me crazy.
Can you manually ping withings?
ping www.withings.com PING www.withings.com (89.30.121.170) 56(84) bytes of data. 64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=1 ttl=51 time=36.4 ms 64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=2 ttl=51 time=33.9 ms 64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=3 ttl=51 time=33.2 ms 64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=4 ttl=51 time=45.8 ms 64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=5 ttl=51 time=32.7 ms 64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=6 ttl=51 time=31.6 ms ^C --- www.withings.com ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5006ms rtt min/avg/max/mdev = 31.632/35.602/45.750/4.764 ms
And the api? https://wbsapi.withings.net/v2/user
gives me the unknown error
Can you post that?
ping https://wbsapi.withings.net/v2/user ping: https://wbsapi.withings.net/v2/user: Naam of dienst is niet bekend
and without the /v2/user?
ping http://wbsapi.withings.net/ ping: http://wbsapi.withings.net/: Naam of dienst is niet bekend
I tried it on my home network wifi and also using my cellphone 4g connection. both give me the same result on different networks.
ping wbsapi.withings.net
PING ws.withings.net (89.30.121.170): 56 data bytes
64 bytes from 89.30.121.170: icmp_seq=0 ttl=55 time=23.458 ms
64 bytes from 89.30.121.170: icmp_seq=1 ttl=55 time=27.044 ms
64 bytes from 89.30.121.170: icmp_seq=2 ttl=55 time=26.917 ms
64 bytes from 89.30.121.170: icmp_seq=3 ttl=55 time=22.834 ms
64 bytes from 89.30.121.170: icmp_seq=4 ttl=55 time=22.937 ms
64 bytes from 89.30.121.170: icmp_seq=5 ttl=55 time=22.620 ms
^C
--- ws.withings.net ping statistics ---
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 22.620/24.302/27.044/1.911 ms
Can you try it like this?
this works
ping wbsapi.withings.net
PING ws.withings.net (89.30.121.170) 56(84) bytes of data.
64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=1 ttl=51 time=41.6 ms
64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=2 ttl=51 time=31.1 ms
64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=3 ttl=51 time=34.7 ms
64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=4 ttl=51 time=31.7 ms
64 bytes from 89.30.121.170 (89.30.121.170): icmp_seq=5 ttl=51 time=34.5 ms
^C
--- ws.withings.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 31.070/34.706/41.641/3.760 ms
this is made from the HA instance?
no from a laptop on the same network. just tried it from the ha raspberry and he last ping works the others don't
I mean this is strange. I know Withings isn't down so this is strange.
Can you maybe try once again:
did all that but to no avail
But it did setup correctly? That's strange
exactly gives the prompt it setup successfully but from there it goes dead
Can you send me a message on discord? @joostlek
I don't think this is a Withings issue - your custom_components sonoff
and tplink_deco
are both also timing out. I previously used the Deco one and found that the load on the Deco from that integration eventually caused the Deco to lock-up necessitating a physical power-off/power-on restart. I would suggest to restart your Deco(s) and remove those two custom_components are try again.
I just experienced this too on a brand new (remove, recreate credentials and reinstall) install. I scanned the body temp and the webhook was not used to update. A subsequent reload of the integration worked and the entities populated. I am experiencing the same timeout issue as the person above with timeouts.
2024-01-28 22:42:27.538 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiowithings/withings.py", line 105, in _request
response = await self.session.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 574, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 911, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect
return await fut
^^^^^^^^^
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiowithings/withings.py", line 104, in _request
async with asyncio.timeout(self.request_timeout):
File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, in __aexit__
raise TimeoutError from exc_val
TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 245, in register_webhook
await async_subscribe_webhooks(client, webhook_url)
File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 288, in async_subscribe_webhooks
await async_unsubscribe_webhooks(client)
File "/usr/src/homeassistant/homeassistant/components/withings/__init__.py", line 314, in async_unsubscribe_webhooks
current_webhooks = await client.list_notification_configurations()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiowithings/withings.py", line 368, in list_notification_configurations
response = await self._request(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiowithings/withings.py", line 113, in _request
raise WithingsConnectionError(msg) from exception
aiowithings.exceptions.WithingsConnectionError: Timeout occurred while connecting to Withings
I'm wondering if could this be IPv6 related? The latency is absolutely dreadful and I saw some packet loss. I'm on a gigabit fibre connection and never saw packet loss before which suggests that Withings routing is just terrible. Is there a way to maybe force IPv4?
Pinging ws.withings.net [2a01:8200:1001:1:89:30:121:170] with 32 bytes of data:
Reply from 2a01:8200:1001:1:89:30:121:170: time=384ms
Reply from 2a01:8200:1001:1:89:30:121:170: time=386ms
Reply from 2a01:8200:1001:1:89:30:121:170: time=439ms
Reply from 2a01:8200:1001:1:89:30:121:170: time=452ms
Ping statistics for 2a01:8200:1001:1:89:30:121:170:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 384ms, Maximum = 452ms, Average = 415ms
Pinging ws.withings.net [89.30.121.170] with 32 bytes of data:
Reply from 89.30.121.170: bytes=32 time=307ms TTL=44
Reply from 89.30.121.170: bytes=32 time=307ms TTL=44
Reply from 89.30.121.170: bytes=32 time=306ms TTL=44
Reply from 89.30.121.170: bytes=32 time=306ms TTL=44
Ping statistics for 89.30.121.170:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 306ms, Maximum = 307ms, Average = 306ms
Wait where do you see packet loss?
PING ws.withings.net (89.30.121.170): 56 data bytes
64 bytes from 89.30.121.170: icmp_seq=0 ttl=54 time=17.828 ms
64 bytes from 89.30.121.170: icmp_seq=1 ttl=54 time=17.910 ms
64 bytes from 89.30.121.170: icmp_seq=2 ttl=54 time=18.157 ms
64 bytes from 89.30.121.170: icmp_seq=3 ttl=54 time=17.893 ms
64 bytes from 89.30.121.170: icmp_seq=4 ttl=54 time=18.098 ms
64 bytes from 89.30.121.170: icmp_seq=5 ttl=54 time=17.765 ms
^C
--- ws.withings.net ping statistics ---
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 17.765/17.942/18.157/0.140 ms
Not in the trace I posted. Geographically speaking, it appears Withings have only one server located in France (89.30.121.170). Unfortunately, that is 19,197 kilometers from me - as the crow flies (not the cable) - which means that latency is always going to be terrible. Only other thing I can think to check is disabling IPv6 (as the latency is poorer). Can you ping and access it fine with IPv6?
I mean, the latency is only 150ms higher tbf. The I just asked @wvdb0 on Discord if he uses IPv6 and he doesn't (and I suspect he doesn't live that far from me)
Apparently I can't ping IPv6, not sure why
I just checked and while some of the DNS servers for withings.net
domain support IPv6, others do not. That is a red flag for me.
I mean, the latency is only 150ms higher tbf. The I just asked @wvdb0 on Discord if he uses IPv6 and he doesn't (and I suspect he doesn't live that far from me)
It shouldn't be any degree noticably higher unless misconfigured.
But, the default timeout is 10 seconds, I am not expecting these 300ms to be such a burden on the connection. Maybe we can give it a shot with just upping the timeout to idk, 600 and seeing what happens
It's averaging around 3 seconds for me just to get a response to a blank request for https://wbsapi.withings.net/v2/user:
{
"status": 2554,
"error": "Not implemented"
}
Do you have discord? Can you maybe send me a message?
Yes and no, we've tried that already. I think I'll send some cURLs for wvdb to test and then we can see what the reason is.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
for a couple of months the withings integration no longer shows accounts and data
What version of Home Assistant Core has the issue?
core-2024.1.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response