ebaauw / homebridge-nb

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

Error messages with two nuki bridges in two instances #114

Closed Nastras closed 1 year ago

Nastras commented 1 year ago

Hi Erik, I have a very strange behavior with the homebridge-nb plugin and I can't define it exactly.

I have two instances of homebridge-nb installed and each has its own nuki bridge.

I constantly get the 503 error in the log for both instances as well as a parser error. Until now I could not explain why and thought that it is because the Nuki Bridge is overloaded.

There are no additional queries of the nuki bridges from other services. There are no additional callbacks registered.

Today 😅 I noticed that both Nuki bridges appear in both instances. 192.168.178.120 and 192.1168.178.51 are both my Nuki Bridges. It looks like both instances of homebridge-nb are constantly polling both nuki bridges.

I think that's where the errors come from. What do you think?

Edit: Both Nuki bridges use port 8080 could this be a problem?

Greetings Nastras

IMG_4579 IMG_4578

IMG_4581 IMG_4580

ebaauw commented 1 year ago

I constantly get the 503 error in the log for both instances as well as a parser error.

What do you mean by "constantly". Your log excerpts only show one of these in 15 minutes.

The 503 is the Nuki bridge reporting that it's not able to handle the request currently. The parse error is from NodeJS's https module, I think. Presumably because the Nuki bridge returns a malformed (non-http) response.

Do you actually have a problem that something is not working, or are you just reporting the error messages?

It looks like both instances of homebridge-nb are constantly polling both nuki bridges.

I don't think so, but please run Homebridge in DEBUG mode, set Log Level to 2 (on the Nuki bridge accessory), and capture and attach the logfile to confirm.

I think this is Homebridge NB looking periodically (every 10 minutes) for new Nuki bridges, checking whether it can actually contact each bridge reported by the Nuki seerver. I see an occasional 503 in my logs as well.

Nastras commented 1 year ago

What do you mean by "constantly". Your log excerpts only show one of these in 15 minutes. I wanted to say that it happens very often. This should only be an excerpt.

Do you actually have a problem that something is not working, or are you just reporting the error messages It has happened to me once or twice so far that I tried to open the lock and nothing happened. I got a 503 error message pushed at the same time via my reporter script for journalctl. Shortly after that the lock opened.

In the meantime I got a third Nukibridge cheap. Now I have for my setup with two nuki locks and an opener for each device a separate nuki bridge and hb instance. So max 1 nuki device for each nuki bridge. It's probably overkill but I wanted to make sure that all devices are controlled at the same time without performance problems through the nuki bridge.

I think this is Homebridge NB looking periodically (every 10 minutes) for new Nuki bridges, checking whether it can actually contact each bridge reported by the Nuki seerver. I see an occasional 503 in my logs as well. I have already installed the new homebridge-nb update yesterday. Since then, the error messages have become less frequent. However, they are still present.

IMG_4588

I don't think so, but please run Homebridge in DEBUG mode, set Log Level to 2 (on the Nuki bridge accessory), and capture and attach the logfile to confirm. I will do that today 😉

ebaauw commented 1 year ago

I wanted to say that it happens very often.

That's not much helpful either. Please be factual: how often, like: every x seconds, minutes, hours, or days?

I have already installed the new homebridge-nb update yesterday. Since then, the error messages have become less frequent.

That version tries to put some time between the polling and the discovery, to limit the load on the Nukie bridge. You still want to make sure not to start the Homebridge NB instances at the same time, or they'll all do discovery at the same time.

However, they are still present.

These are warning messages, not errors. If they happen regularly they might indicate an underlying issue. If they happen occasionally and irregularly, it's just a case of "shit happens". As I've mentioned before, the Nuki bridge isn't very powerful and occasional warnings are to be expected. Next to a 503, I also sometimes see a "warning: heartbeat error: Parse Error: Invalid character in chunk size".

Nastras commented 1 year ago

That's not much helpful either. Please be factual: how often, like: every x seconds, minutes, hours, or days?

You're right. My statement was not really helpful.

Until yesterday before the homebridge-nb update I received the messages as shown on the screens above in the journalctl every hours. It was always exactly after 60 min that the messages occurred again.

That version tries to put some time between the polling and the discovery, to limit the load on the Nukie bridge. You still want to make sure not to start the Homebridge NB instances at the same time, or they'll all do discovery at the same time.

Since I turned on the debug mode for the homebridge-nb instances today and rebooted all nuki bridges no more messages appeared. It looks like everything is quiet in the journalctl.

I will leave the debug mode on until tomorrow evening. If no more events appear I think your fix has been successful.

I will report again tomorrow.

Thank you!

Nastras commented 1 year ago

There is still no more message. Not even in debug mode. I think with the last update you have fixed the problem. I close here and thank you again for the great work!