chrisjshull / homebridge-nest

Nest plugin for HomeBridge
707 stars 111 forks source link

Error: Stream closed with error code NGHTTP2_INTERNAL_ERROR #493

Closed vzlgdu closed 2 years ago

vzlgdu commented 2 years ago

Sometimes I receive the following error:

gen 11 00:10:03 homebridgea homebridge[5559]: [11/1/2022, 00:10:03] [Nest] API observe: error Error: Stream closed with error code NGHTTP2_INTERNAL_ERROR gen 11 00:10:03 homebridgea homebridge[5559]: at new NodeError (node:internal/errors:371:5) gen 11 00:10:03 homebridgea homebridge[5559]: at ClientHttp2Stream._destroy (node:internal/http2/core:2313:13) gen 11 00:10:03 homebridgea homebridge[5559]: at _destroy (node:internal/streams/destroy:102:25) gen 11 00:10:03 homebridgea homebridge[5559]: at ClientHttp2Stream.destroy (node:internal/streams/destroy:64:5) gen 11 00:10:03 homebridgea homebridge[5559]: at Http2Stream.onStreamClose (node:internal/http2/core:545:12) { gen 11 00:10:03 homebridgea homebridge[5559]: code: 'ERR_HTTP2_STREAM_ERROR' gen 11 00:10:03 homebridgea homebridge[5559]: } gen 11 00:10:03 homebridgea homebridge[5559]: [11/1/2022, 00:10:03] [Nest] Retrying in 10 seconds

The environment is:

RPI4 HB 1.3.9

Can you help me?

Thanks

Nastras commented 2 years ago

Same 4 me.

adriancable commented 2 years ago

@Nastras - what exactly is "the same for you"? Do you just find the messages ugly, or do you actually have a functional issue with the plug in?

Nastras commented 2 years ago

Hey @adriancable,

I also get the message very often. Unfortunately, I do not know what this exactly says or what the problem is.

The plugin says Retrying in 10 seconds. But nothing happens, the message remains in the log. Very often I get a message in Homekit that the smoke detectors are not available until I restart the instance.

I am not sure if it is related to this but last week all Nest Protect devices disappeared from Homekit. Shortly after that they were added as new. Of course, all automations were broken as a result.

I haven't made any changes to the Nest hardware or your plugin in a long time. It has actually been working very well so far.

E90F7283-11A9-48FD-896F-5862A73CB45B

adriancable commented 2 years ago

@Nastras - this message is completely normal. It does not indicate there is a problem. If you have other issues, this message will not give any insight because it is normal. You cannot expect your Internet provider, the Nest service, and all the infrastructure in between to have 100% uptime. Sometimes API requests will fail. All that matters is that the client handles the failure properly. The homebridge-nest plug-in, like every other piece of software that talks to the cloud should do, does indeed handle failures properly. That's what the "retrying in 10 seconds" is there for.

If you have a message in HomeKit saying that the smoke detectors are not available, please provide a screenshot of that message so we can debug that.

If Homebridge devices disappear from HomeKit, it means that you have lost the contents of the ~/.homebridge/persist folder. You will need to debug why this may happen because I do not have any information on where and how you are running Homebridge. Examples of how it may happen: unclean shutdown of the machine prevents pending writes to this folder from being flushed (e.g. pulling the power cord out). Or you are using a Docker container which starts in a 'virgin' state when restarted.

Nastras commented 2 years ago

If you say that the message is not an error then it is good. I just find it very irritating that the plugin says retrying in 10 seconds but nothing happens.

It then looks as if the plugin has hung up. At least if you only have nest protect πŸ˜…

I am running homebridge on a pi 4. each plugin has its own instance. Why the persist file has deleted itself was understandable for me. There was nothing apparent in the log. I could only imagine that it was an error during the automatic nightly reboot of the pi.

adriancable commented 2 years ago

@Nastras - what do you mean when you say "nothing happens"? The plug-in retries its call to the Nest service in 10 seconds (as it is advising), and if that call succeeds, then naturally it doesn't print another error. Surely since the alternative is getting another error, the fact that "nothing happens" is a good thing?

Remember - the intended consumer of the log is not you, it's me (the plug-in developer). If you have a problem, then the log can be useful for me to figure out what may be happening. If you do not have a problem, then what is in the log is not meaningful for you.

Nastras commented 2 years ago

I mean that the log does not show that the retrying of the nest api was successful after 10 seconds.

Since I only have the Nest Protect is a status change that is displayed in the log only rarely.

That's why I always have this red error message as the last status in the log.

If the plugin would show in the log that it has successfully sent a new request to the api it would be more understandable for the user.

Nastras commented 2 years ago

I think that the log can also be very helpful for the user to identify errors. Not only for the developer πŸ˜‰

Without log I would be completely lost at homebridge πŸ˜…πŸ˜…πŸ˜…

jom commented 2 years ago

I am also experiencing this issue. I see this in the log and then after that point the state for my Nest devices stops updating. I assume this is with all devices, but the only one I monitor the state of is the thermostat. The devices still show up, but they don't get updates for the heating state or target temperature (for example).

Once I notice the state isn't updating, my only solution is to go in and restart Homebridge. That seems to temporarily fix it for me (I have to do this every 1 to 5 days or so... it really varies).

adriancable commented 2 years ago

Fixed in 4.6.4, now released.