chrisjshull / homebridge-nest

Nest plugin for HomeBridge
716 stars 112 forks source link

ECONNRESET error messages #255

Closed mbierman closed 4 years ago

mbierman commented 4 years ago

Describe the bug

I'm often seeing the following:

[5/20/2020, 9:25:04 AM] [Nest] API observe: error Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
}

To Reproduce Steps to reproduce the behavior:

  1. Nothing in particular, just running the nest plugin.

Expected behavior No errors

Include with your bug report this version info:

Module Version
Node.js 12.16.3
NPM 6.14.5
homebridge 1.1.0
Alpine Linux (running in a Docker on a Synology) 3.11.6
homebridge-chamberlain 1.6.0
homebridge-nest 4.4.6

I wonder if it is related to this issue.

Also include debug log output from startup through seeing the issue: DEBUG=* homebridge -D

I'll provide a debug log the next time it occurs.

mbierman commented 4 years ago

sample2.log.zip

d3bing commented 4 years ago

I'm getting this on mine every 10 seconds: [Nest] Nest API call to subscribe to device settings updates returned an error: ECONNRESET

QandnotU commented 4 years ago

The same is happening to me as well, it's happening fairly consistently, please let me know if I can provide logs to help track down whats throwing the warning.

QandnotU commented 4 years ago

    at closeSession (internal/http2/core.js:1054:20)
    at ClientHttp2Session.destroy (internal/http2/core.js:1408:5)
    at TLSSocket.socketOnError (internal/http2/core.js:2770:13)
    at TLSSocket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:100:8)
    at emitErrorCloseNT (internal/streams/destroy.js:68:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  cause: Error: getaddrinfo ENOTFOUND grpc-web.production.nest.com
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'grpc-web.production.nest.com'
  },
  code: 'ERR_HTTP2_STREAM_CANCEL'
}
[5/22/2020, 1:02:32 AM] [Nest] Retrying in 10 seconds.
[5/22/2020, 1:03:13 AM] [Nest] API observe: error Error [ERR_HTTP2_STREAM_CANCEL]: The pending stream has been canceled (caused by: getaddrinfo ENOTFOUND grpc-web.production.nest.com)
    at closeSession (internal/http2/core.js:1054:20)
    at ClientHttp2Session.destroy (internal/http2/core.js:1408:5)
    at TLSSocket.socketOnError (internal/http2/core.js:2770:13)
    at TLSSocket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:100:8)
    at emitErrorCloseNT (internal/streams/destroy.js:68:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  cause: Error: getaddrinfo ENOTFOUND grpc-web.production.nest.com
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'grpc-web.production.nest.com'
  },
  code: 'ERR_HTTP2_STREAM_CANCEL'
}
[5/22/2020, 1:03:13 AM] [Nest] Retrying in 10 seconds.
[5/22/2020, 1:51:41 AM] [Nest] Nest API call to subscribe to device settings updates returned an error: ENOTFOUND
[5/22/2020, 1:51:41 AM] [Nest] Retrying in 10 seconds.
[5/22/2020, 2:43:38 AM] [Nest] Nest API call to subscribe to device settings updates returned an error: ENOTFOUND
[5/22/2020, 2:43:38 AM] [Nest] Retrying in 10 seconds.
[5/22/2020, 2:44:19 AM] [Nest] Nest API call to subscribe to device settings updates returned an error: ENOTFOUND
[5/22/2020, 2:44:19 AM] [Nest] Retrying in 10 seconds.
[5/22/2020, 2:49:09 AM] [Nest] Nest API call to subscribe to device settings updates returned an error: ENOTFOUND
[5/22/2020, 2:49:09 AM] [Nest] Retrying in 10 seconds.
[5/22/2020, 2:49:49 AM] [Nest] Nest API call to subscribe to device settings updates returned an error: ENOTFOUND
[5/22/2020, 2:49:49 AM] [Nest] Retrying in 10 seconds.
[5/22/2020, 8:29:05 AM] [DND] Setting switch to false```
adriancable commented 4 years ago

Two different errors here.

ENOTFOUND is a DNS lookup error. It means something's wrong with your Internet connection set-up on whatever device you're running homebridge, or a DNS issue on Nest's side (unlikely).

ECONNRESET means that the connection to the Nest service was broken uncleanly. Again it is a network issue, either on your side, or on the Nest side. When it happens, homebridge-nest will try to immediately reconnect, so this error probably has minimal impact to you.

Neither errors are homebridge-related, so you should look for other causes.

QandnotU commented 4 years ago

Thanks for the quick reply Adrian, it doesn't seem to affect functionality. I'm running a few beta features on my Eero, wondering if one of those could be causing issues. I'll investigate. Thanks again.

adriancable commented 4 years ago

@QandnotU - there appears to be an issue with Eero blocking DNS on HomeKit devices when HomeKit Secure is enabled, even if your Homebridge instance is set to 'No Restriction'. It's strange because devices can run for weeks and then suddenly DNS can stop working. If you restart your Eero network you may find things start working again - can you try?

QandnotU commented 4 years ago

@adriancable i haven’t seen those warnings return since restarting Eero and Homebridge. Thank you.

mbierman commented 4 years ago

I'm still seeing this.

[6/22/2020, 12:33:47 PM] [Nest] API observe: error Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
}

What DNS traffic does Eero block that is causing the issue?

adriancable commented 4 years ago

@mbierman - nothing to do with Eero. See my message a few posts above explaining what it means and why you probably shouldn't worry.

donavanbecker commented 4 years ago

@adriancable I know @dgreif changes some things in v9.0.0 of homebridge-ring. Maybe something to look over? This fixed all issue I had with Eero and HomeKit secure.

dgreif commented 4 years ago

@donavanbecker those were specifically targeted at live streaming issues, which isn't really applicable here. @adriancable for reference I had issues with Eero using strict NAT, which meant regular UDP hole punching didn't work for camera live streams. From what I understand, Nest is using websockets for live streams so you don't have to worry about how UDP gets through the NAT. I also switched from axios to got for http request, with DNS caching and keepalive for almost all requests.

adriancable commented 4 years ago

@dgreif - thanks for your note - yes, you're correct that Nest uses websockets for video and so there's nothing specific about Eero that affects this. (I have an Eero set-up here, and am mostly happy with it.)

There is some kind of strange interaction between Homebridge and Eero whereby, even if the Homebridge machine is set to 'No Restriction' in Eero HSR config, Eero will (after things running fine for days/weeks) suddenly block external traffic from the machine. To my knowledge, it isn't understood why this happens, and a restart of the Eero network fixes it ... for another few days/weeks.

That's the only Homebridge/Eero issue I'm aware of.

mbierman commented 4 years ago

@adriancable thanks. I dislike seeing errors on my network. :)

I have multiple places that could be causing them so I like to rule each out.

I have eeros but am not using them for anything except APs. So I'm guessing they aren't the issue.

But, I also have a firewalla which has rules that are meant to block unusual activity. So I was trying to figure out why I am seeing those. If I have created a rule that is in the way, I should fix that. If the connection between nest and me is flakey... I'd like to see if I can figure out why.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

trigger2k20 commented 3 years ago

Hi Adrian, Hi All, sorry but i still have this error and i drives me crazy sinde at least 2 years (It suddenly came up). I do thenreset but i cames back as written above. I am not an expert and i have a 100% no problem with DNS since my family has 3 vidoe conferences running in parallel during lockdown. So can PLEASE someone write how to check/resove this issue in way that normal mortals can understand and fix. If it's complicated i am happy to get intstructions via remote session. I have NEST PROTECT and get this variation: [4/11/2021, 10:53:20 AM] [Nest Protect] API observe: error Error: read ECONNRESET at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27) { errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' } Thank you all for your help (Please!) and stay safe :-)

adriancable commented 3 years ago

@trigger2k20 - this message is harmless and can be ignored.

Your ISP + the Internet + Nest's cloud services together, are not 100% reliable and sometimes connections get dropped. If this happens the plug-in immediately picks up where it left off, so these quick dropped connections do not matter and do not cause any issues.

Hope this helps.

trigger2k20 commented 3 years ago

Hi Adrian, thx for answering ! So if the do not cause any issues and so much people are complaing, why not program a switch to supress this message ? Btw, ist there a possiblity to switch to 24 time scale ?