ebaauw / homebridge-nb

Homebridge plugin for Nuki Bridge
Apache License 2.0
51 stars 3 forks source link

503 every 10 Minutes #63

Closed solbadguy2010 closed 2 years ago

solbadguy2010 commented 2 years ago

Hi, this Plugin is working fine for me, but i do get an 503 warning every 10 minutes. What have i done wrong?

[16/04/2022, 11:21:25] [Nuki] warning: 10.0.1.41: request 1: GET /info [16/04/2022, 11:21:25] [Nuki] warning: 10.0.1.41: request 1: error: http status 503 Service Unavailable [16/04/2022, 11:22:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:21:25" to "Sat Apr 16 2022 11:22:25" [16/04/2022, 11:23:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:22:25" to "Sat Apr 16 2022 11:23:25" [16/04/2022, 11:24:18] [Nuki] Zuhause Sensor: set Contact Sensor State from 0 to 1 [16/04/2022, 11:24:18] [Nuki] Zuhause Sensor: set Times Opened from 13 to 14 [16/04/2022, 11:24:18] [Nuki] Zuhause Sensor: set Last Activation from 140889 seconds to 142633 seconds [16/04/2022, 11:24:25] [Nuki] Nuki_Bridge_D57AA82: request 6981: GET /callback/list [16/04/2022, 11:24:25] [Nuki] Nuki_Bridge_D57AA82: warning: request 6981: error: http status 503 Service Unavailable [16/04/2022, 11:24:25] [Nuki] Nuki_Bridge_D57AA82: warning: heartbeat error: http status 503 Service Unavailable [16/04/2022, 11:24:26] [Nuki] Zuhause Sensor: set Contact Sensor State from 1 to 0 [16/04/2022, 11:24:26] [Nuki] Zuhause Sensor: set Last Activation from 142633 seconds to 142640 seconds [16/04/2022, 11:25:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:23:25" to "Sat Apr 16 2022 11:25:25" [16/04/2022, 11:25:25] [Nuki] Zuhause Lock: set Last Updated from "Sat Apr 16 2022 10:56:09" to "Sat Apr 16 2022 11:24:21" [16/04/2022, 11:25:25] [Nuki] Zuhause Sensor: set Last Updated from "Sat Apr 16 2022 10:56:09" to "Sat Apr 16 2022 11:24:21" [16/04/2022, 11:26:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:25:25" to "Sat Apr 16 2022 11:26:25" [16/04/2022, 11:27:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:26:25" to "Sat Apr 16 2022 11:27:25" [16/04/2022, 11:28:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:27:25" to "Sat Apr 16 2022 11:28:25" [16/04/2022, 11:29:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:28:25" to "Sat Apr 16 2022 11:29:25" [16/04/2022, 11:30:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:29:25" to "Sat Apr 16 2022 11:30:25" [16/04/2022, 11:31:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:30:25" to "Sat Apr 16 2022 11:31:25" [16/04/2022, 11:31:25] [Nuki] warning: 10.0.1.41: request 1: GET /info [16/04/2022, 11:31:25] [Nuki] warning: 10.0.1.41: request 1: error: http status 503 Service Unavailable [16/04/2022, 11:32:17] [Nuki] warning: heartbeat 140452, drift 281 [16/04/2022, 11:32:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:31:25" to "Sat Apr 16 2022 11:32:25" [16/04/2022, 11:33:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:32:25" to "Sat Apr 16 2022 11:33:25" [16/04/2022, 11:34:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:33:25" to "Sat Apr 16 2022 11:34:25" [16/04/2022, 11:35:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:34:25" to "Sat Apr 16 2022 11:35:25" [16/04/2022, 11:36:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:35:25" to "Sat Apr 16 2022 11:36:25" [16/04/2022, 11:37:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:36:25" to "Sat Apr 16 2022 11:37:25" [16/04/2022, 11:38:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:37:25" to "Sat Apr 16 2022 11:38:25" [16/04/2022, 11:39:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:38:25" to "Sat Apr 16 2022 11:39:25" [16/04/2022, 11:39:58] [Nuki] Nuki_Bridge_D57AA82: Log Level changed from 2 to 1 [16/04/2022, 11:40:25] [Nuki] Nuki_Bridge_D57AA82: set Last Updated from "Sat Apr 16 2022 11:39:25" to "Sat Apr 16 2022 11:40:25" [16/04/2022, 11:40:53] [Nuki] Nuki_Bridge_D57AA82: Log Level changed from 1 to 0 [16/04/2022, 11:41:25] [Nuki] warning: 10.0.1.41: request 1: GET /info [16/04/2022, 11:41:25] [Nuki] warning: 10.0.1.41: request 1: error: http status 503 Service Unavailable [16/04/2022, 11:51:25] [Nuki] warning: 10.0.1.41: request 1: GET /info [16/04/2022, 11:51:25] [Nuki] warning: 10.0.1.41: request 1: error: http status 503 Service Unavailable [16/04/2022, 11:55:01] [HomeConnect] [Geschirrspüler] Door open [16/04/2022, 12:01:25] [Nuki] warning: 10.0.1.41: request 1: GET /info [16/04/2022, 12:01:25] [Nuki] warning: 10.0.1.41: request 1: error: http status 503 Service Unavailable [16/04/2022, 12:11:25] [Nuki] warning: 10.0.1.41: request 1: GET /info [16/04/2022, 12:11:25] [Nuki] warning: 10.0.1.41: request 1: error: http status 503 Service Unavailable [16/04/2022, 12:21:25] [Nuki] warning: 10.0.1.41: request 1: GET /info [16/04/2022, 12:21:25] [Nuki] warning: 10.0.1.41: request 1: error: http status 503 Service Unavailable

ebaauw commented 2 years ago

It’s an error returned by the Nuki bridge. Do you have any other clients connecting to it? Did you try and power-cycle it?

solbadguy2010 commented 2 years ago

I just power-cycled the Nuki Bridge nothing changed. I then completely rebooted Homebridge. The error is still there but the time-window the error occurs changed to every 10 Minutes after HB reboot. Looks like the plugin in causing the error, not the Nuki Bridge.

i had Nukiio inistalled parallel for testing which one i liked more, but uninstalled it in favor of your days ago.

solbadguy2010 commented 2 years ago

Funny. When i open http://10.0.1.41:8080/info?token=123456 in my Browser and refresh again and again the Website also gives me a 503 exactly to the time i get the error in the logs. All other moments i get a correct answer. Maybe the problem is in The process running on port 8080?

ebaauw commented 2 years ago

Looks like the plugin in causing the error, not the Nuki Bridge.

The plugin is reporting the http status 503 as returned by the Nuki bridge. The bridge is not very powerful, and tends to choke when multiple clients are interacting with it concurrently.

Maybe the problem is in The process running on port 8080?

Yes it is. Note that this is a server process running on the Nuki bridge.

My guess is there’s another client polling the bridge every 10 minutes. You might want to shutdown Homebridge and check the bridge log (through nb getlog), to see if it still receives a request every 10 minutes. Unfortunately, the log doesn’t show the client IP address, so you would need to sniff the network or shutdown all your devices in turn, to figure out which one is contacting the bridge. I suppose it could also be a cloud-based integration, maybe Alexa or Hey Google or IFTTT.

solbadguy2010 commented 2 years ago

Ok, i fixed it somehow. No error in the log the last 20 minutes. I have done multiple things.

  1. At first i removed your plugin and installed Nukiio again. Just to Check. There were the same connection problems. I then uninstalled it, so that both plugins were gone, then rebooted HB.
  2. I checked everything i used in the past like IFTTT, but no Nuki connected. I then thought about Nuki Web and saw, that Nukis own Homekit Service was still aktive. I removed the lock from Home, but did not disable the function in the Nuki Settings. I disabled it, but kept Nuki Web active.
  3. I reinstalled your Plugin as a separate sub bridge and paired it again and added it to Homekit.

I am not sure it was Nukis own Homekit Service, but i think it could be, that the ATV scanned for new bridges every 10 minutes? Only guessing here. Nevertheless, it works now. Thanks for your help and the great plugin.

solbadguy2010 commented 2 years ago

Error is back :-/

solbadguy2010 commented 2 years ago

I think i fixed it now. I uninstalled a Plugin that caused constant CPU load on the PI (Printer Plugin by Seydx). In addition i reduced the activity of the GPIO service following this post: https://forum.radxa.com/t/pigpiod-eating-7-cpu-nonstop/3911

With less going on in the taskmanager htop the error is gone currently.

solbadguy2010 commented 2 years ago

Sadly the error is still there. Less often, but constand. Wiresharked the network. Nothing found. Any other idea?

ebaauw commented 2 years ago

No. The error is returned by the Nuki bridge; I doubt the load on the server running Homebridge has anything to do with this.

Wiresharked the network. Nothing found.

You would need to sniff the WiFi traffic to/from the Nuki bridge, to see if other clients (than Homebridge NB) connect. I doubt this can be done with WireShark running on a PC. You would need to capture the traffic on your router or wireless access point.

Did you have a look at the Nuki bridge log?

waterchill commented 1 year ago

I have same problem, anyone solved it?

solbadguy2010 commented 1 year ago

I have deleted the plugin because of its constant errors and unreliability.

waterchill commented 1 year ago

And what plugin are you using now?

solbadguy2010 commented 1 year ago

None. I stay with the original homekit implementation.

waterchill commented 1 year ago

I have bought the Nuki v3 wit homekit implementation but sadly it has no Lock and Latch in the homekit so you cannot unlatch the door. So I stay with v1 and these warnings every 10min :(

ebaauw commented 1 year ago

I don’t have the v3 lock myself, but I understand, you can pair it with the Nuki bridge as well.

waterchill commented 1 year ago

Doesn't matter if v2 or v3 both do not support unlatch door in homekit.

Nastras commented 1 year ago

Hello Erik,

I also have the problem that I often get a 503 message. If this message occurs once, I also get it every 10 minutes.

I have noticed over the last few days that restarting the nuki bridge does not bring any improvement.

When I restart the plugin I don't get the 503 message for several hours. So my question could the 503 error be caused by the plugin?

I don't have any additional callbacks on the nuki bridge.

Nastras commented 1 year ago

I have tested it a few more times now. By restarting homebridge-nuki I was able to fix the error for several hours or even a day until it occurs again.

jason-schell commented 11 months ago

I have tested it a few more times now. By restarting homebridge-nuki I was able to fix the error for several hours or even a day until it occurs again.

I can confirm the same behaviour. A restart helps for a few hours, but then the errors come back and flood the logfile. CleanShot 2023-08-21 at 12 08 10@2x