kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
185 stars 36 forks source link

Failed to get latest data: Http response: 503 #6

Closed chpego closed 2 years ago

chpego commented 3 years ago

From HA (2021.11.5) with the last version of this custom_components, i've several errors :

Logger: custom_components.nuki_ng.nuki
Source: custom_components/nuki_ng/nuki.py:40
Integration: Nuki Lock (documentation, issues)
First occurred: 22 novembre 2021 à 06:22:34 (197 occurrences)
Last logged: 09:39:43
Failed to get latest data: Http response: 503

Traceback (most recent call last):
  File "/config/custom_components/nuki_ng/nuki.py", line 208, in _update
    info = await self.api.bridge_info()
  File "/config/custom_components/nuki_ng/nuki.py", line 66, in bridge_info
    return await self.async_json(lambda r: r.get(self.bridge_url("/info")))
  File "/config/custom_components/nuki_ng/nuki.py", line 40, in async_json
    raise ConnectionError(f"Http response: {response.status_code}")
ConnectionError: Http response: 503

I've a physical bridge

badewanne1234 commented 3 years ago

Same/similar here, it throws a HTTP-400 error though. The lock does not report the status reliable, i.e. it does not update the status in all cases - I have a phyiscal bridge and a Nuki 2.0 lock.

Logger: custom_components.nuki_ng.nuki
Source: custom_components/nuki_ng/nuki.py:40
Integration: Nuki Lock (documentation, issues)
First occurred: 23. November 2021, 18:05:40 (422 occurrences)
Last logged: 07:19:00
Failed to update callback https://******/api/webhook/nuki_ng_bridge_hook_***

Traceback (most recent call last):
  File "/config/custom_components/nuki_ng/nuki.py", line 203, in _update
    callbacks_list = await self.api.bridge_check_callback(self.bridge_hook)
  File "/config/custom_components/nuki_ng/nuki.py", line 111, in bridge_check_callback
    result = await self.async_json(
  File "/config/custom_components/nuki_ng/nuki.py", line 40, in async_json
    raise ConnectionError(f"Http response: {response.status_code}")
ConnectionError: Http response: 400
kvj commented 3 years ago

@chpego

i've several errors

Does the integration work in general or not? In other words, are all updates failing or only some? Because I also get 503s from time to time, as bridge itself isn't very stable

@badewanne1234

Failed to update callback https://******/api/webhook/nuki_ng_bridge_hook_***

The bridge (not integration) doesn't support HTTPS. So you're in the polling only mode

chpego commented 3 years ago

@chpego

i've several errors

Does the integration work in general or not? In other words, are all updates failing or only some? Because I also get 503s from time to time, as bridge itself isn't very stable

Yes, it's works, but 197 occurrences of code 503 seems to be many times

alexdelprete commented 3 years ago

Yes, it's works, but 197 occurrences of code 503 seems to be many times

The bridge is a bad piece of hw, it only supports one connection at a time, it doesn't support HTTPS, but if it happens so often, it probably means you are using more than one app/component that is communicating with the bridge (the official app, web int., other components, automations, etc.). If too many requests are received, it throws error 503 and only serves one at a time.

It's a very well known issue with Nuki, their forums are full of these issues...

Personally, since I've made Nuki Card integration, and now with Konstantin's custom component, I uninstalled all Nuki apps and not using anything else to manage, and I rarely have 503 errors.

badewanne1234 commented 3 years ago

Failed to update callback https://***_**/api/webhook/nuki_ng_bridge_hook_**_

The bridge (not integration) doesn't support HTTPS. So you're in the polling only mode

Oh, bugger - I have NGINX in place but forgot to configure Nuki for HTTP - I reconfigured it, now the 400 errors are gone - now I just got a warning with two occurencies of an unregistered webhook. Assuming this can be ignored?

chpego commented 2 years ago

Yes, it's works, but 197 occurrences of code 503 seems to be many times

The bridge is a bad piece of hw, it only supports one connection at a time, it doesn't support HTTPS, but if it happens so often, it probably means you are using more than one app/component that is communicating with the bridge (the official app, web int., other components, automations, etc.). If too many requests are received, it throws error 503 and only serves one at a time.

It's a very well known issue with Nuki, their forums are full of these issues...

Personally, since I've made Nuki Card integration, and now with Konstantin's custom component, I uninstalled all Nuki apps and not using anything else to manage, and I rarely have 503 errors.

ok, i just deactivated the official version component in HA i was using and see if i have this error code less

alexdelprete commented 2 years ago

ok, i just deactivated the official version i was using and see if i have this error code less

do you have a v1 or v2 bridge? hope it's not the v1...

chpego commented 2 years ago

ok, i just deactivated the official version i was using and see if i have this error code less

do you have a v1 or v2 bridge? hope it's not the v1...

Yep, v2 bridge :)

alexdelprete commented 2 years ago

good...it has problems, but v1 is a total disaster. ;)