Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning: ReferenceError: err is not defined #13

Closed
Nastras opened this issue Jan 27, 2020 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@Nastras
Copy link

Nastras commented Jan 27, 2020

Hello @thoukydides,

my homebridge homeconnect instance crashed today. What surprised me was that the homebridge was not restarted by itself, it just stopped.

I am not sure if the error is known or if it is related to the homeconnect api. Unfortunately I didn't have the DEBUG mode enabled, so I can only show you an excerpt from the journalctl.

I hope it helps you anyway.

Log.txt

King regards
Nastra

@Nastras Nastras added the bug Something isn't working label Jan 27, 2020
@thoukydides
Copy link
Owner

my homebridge homeconnect instance crashed today. What surprised me was that the homebridge was not restarted by itself, it just stopped.

The log file shows that Homebridge shutdown because it received SIGTERM. This normally only occurs when it is explicitly stopped, e.g. using systemctl stop or kill -SIGTERM. I have never seen this being caused by a Homebridge plugin... and the log file does not show any activity by this plugin around the time of the shutdown.

The earlier errors in the log file are not the cause of Homebridge crashing. They were introduced by 0ef4762 as part of v0.16.2. Their only affect (other than the log messages) is that the appliance is not treated as disconnected when the event stream is disconnected. I will fix them in the next release.

As to the SIGTERM, I cannot think of any way that this plugin could be the cause. Unless you can provide more information or I see it myself there isn't anything that I can do about it.

@Nastras
Copy link
Author

Nastras commented Jan 27, 2020

The log file shows that Homebridge shutdown because it received SIGTERM. This normally only occurs when it is explicitly stopped, e.g. using systemctl stop or kill -SIGTERM. I have never seen this being caused by a Homebridge plugin... and the log file does not show any activity by this plugin around the time of the shutdown.

The SIGTERM at 17:35:58 SHS was me after I discovered the error.
I meant the entry from 14:26:44 to 17:03:05 where the instance with this error is frozen without restart.

After I manually rebooted, the instance was running again.

I cannot think of any way that this plugin could be the cause. Unless you can provide more information or I see it myself there isn't anything that I can do about it.

I now leave the debug mode enabled for homebridge-homeconnect so that I can provide you with better information in the future :-)

I will fix them in the next release.

👍👍👍

@thoukydides
Copy link
Owner

I have fixed that error in 0.16.4.

Not sure why it would result in Homebridge freezing though. What were the symptoms?

@Nastras
Copy link
Author

Nastras commented Jan 27, 2020

I will install the update tomorrow because I want to see if the error occurs again.

The symptoms were that Journalctl did not perform any update.

I found out by a script which searches the homebridge's journalctl for certain words like error and sends me a telegram.

@thoukydides
Copy link
Owner

The symptoms were that Journalctl did not perform any update.

Do you normally see updates in the homebridge log when everything is idle? The log you provided does not show any entries between 02:26:45 and 14:26:44, which is precisely what I would expect.

After the initial start-up, this plugin should only issue non-debug log messages when:

  • An appliance is controlled from HomeKit
  • The event stream indicates a change of appliance state
  • An error occurs, or the event stream terminates without an error

With -D debug logging there will be some messages once per hour when the plugin polls the list of appliances, but not necessarily anything else.

Without -D debug logging enabled or API errors, there should not be anything written regularly to the log. It should only record when the appliances are active or when you are interacting with them.

In practice the event stream does terminate occasionally, so that results in some log entries (and in particular the errors you saw). However, there isn't a fixed timeout, so the absence of this occurring does not indicate that the plugin has frozen.

Unless I am misunderstanding, it sounds like the only issue was the error messages which are understood...

@Nastras
Copy link
Author

Nastras commented Jan 28, 2020

Hello, error has just occurred again. I am on the road and only have one mobile phone with me so I have created two screens for you.

There seems to be an API error, right?

I hope you can do something with them.

22C0FEF4-BB4D-4821-A38F-E04EFB246CF4

06EC4CB4-A37B-463C-9070-04C90B20670B

@thoukydides
Copy link
Owner

These screenshots show:

  1. The Home Connect servers unexpectedly terminated the event stream with a Proxy Error. This is one of the errors that occurs when the servers have problems; see Error Messages. The log shows this plugin attempting to re-establish the event stream, but there is insufficient of the log to tell whether it was successful.
  2. The error that I fixed in v0.16.4. Presumably this means that you have not updated your installation.

Basically, nothing new here.

I am going to close this issue now because I believe that the bug is fixed in v0.16.4. There is nothing that I can do about the Home Connect servers having problems and returning unexpected errors.

@Nastras
Copy link
Author

Nastras commented Jan 28, 2020

The Home Connect servers unexpectedly terminated the event stream with a Proxy Error. This is one of the errors that occurs when the servers have problems; see Error Messages. The log shows this plugin attempting to re-establish the event stream, but there is insufficient of the log to tell whether it was successful.

That's what I thought after seeing the message now in DEBUG mode. Wasn't clear yesterday though.

The error that I fixed in v0.16.4. Presumably this means that you have not updated your installation.

Will do now 😉

I am going to close this issue now because 👍

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants