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

ENETUNREACH: Failed to reach Ring server at https://oauth.ring.com/oauth/token #523

Closed
dxdc opened this issue Dec 9, 2020 · 13 comments
Closed
Labels
bug Something isn't working

Comments

@dxdc
Copy link

dxdc commented Dec 9, 2020

Bug Report

Describe the Bug

A clear and concise description of the problem...

Today, I noticed a slew of these in my logs (every 5 seconds). And, Ring cams in HK were not updating either.

[12/8/2020, 2:13:30 PM] [Ring] Failed to reach Ring server at https://oauth.ring.com/oauth/token.  connect ENETUNREACH <IPV6>:443 - Local (:::0).  Trying again in 5 seconds...
...(every 5 seconds...)

Restarting HB fixed the problem entirely, but it got me wondering why it happened in the first place. I initiated a router restart at the time the error started. I'm not sure whether or not the cameras were in use (e.g., via HK) at the time of the router restart... though not sure if that would have impacted.

I had two thoughts relating to this:

  1. Maybe it's some kind of caching issue with the DNS when the router was restarted? I'm not as familiar with that logic, but curious if null value could be stored due to this (e.g., some kind of null response from DNS) and then it affects future retries. Possibly even related to IPV6?

  2. Maybe an exponential backoff is better than trying every 5 seconds? If Ring is rate limiting the pinging, not sure if trying every 5 seconds is helpful for that?

Noting it in case this was related to prior issues, at least in part.

Environment

  • Raspbian
  • Node.js: 10.23.0
  • NPM: 6.14.9
  • homebridge-ring: 9.12.6
@dxdc dxdc added the bug Something isn't working label Dec 9, 2020
@clipse2004
Copy link

Same error here, but cannot fix it. (Restart doesn’t help)

@breedcc
Copy link

breedcc commented Dec 11, 2020

Same error here. Restart seems to get it going again for a few hours then starts throwing error again.

Raspbian
Node.js: 12.9.0
NPM: 6.4.18
homebridge-ring: 9.12.8

@Casuallynoted
Copy link

Same issue here. Attempting to recreate the 2FA code results in an error saying that my login info is incorrect, but I can log into the ring site with the same info just fine.

@clipse2004
Copy link

Mmh no respond :/

@L4RGER
Copy link

L4RGER commented Dec 19, 2020

Same error here,
HB running in portainer via home assistant.
had to power cycle RPi the other day and have Had error since. 3-4days now.
have tried rebooting host and restarting homebridge many times. Haven’t looked at trying a new refresh key yet.
working fine via ring app.
234F0530-5120-4B26-9008-FDE249EE5EC1

@L4RGER
Copy link

L4RGER commented Dec 21, 2020

I’ve tried removing plug-in and reinstalling and same error
Edit:
Actually mine could be a different error. Doesn’t have ENETUNREACH.
Will open a new issue

@dgreif
Copy link
Owner

dgreif commented Dec 26, 2020

@dxdc sorry for the delayed response, spending time with the family over the holidays. Have you figured out anything on this issue? Honestly, I think you are better at debugging these DNS issues than I am and I haven't seen this issue at all. My guess is that the DNS caching is causing the issue to permanently break the plugin once it gets a bad dns record, but at some point it's getting a bad DNS response that points to localhost or something equivalent. It may be as simple as updating node since it looks like you are on a pretty old version.

@dxdc
Copy link
Author

dxdc commented Dec 26, 2020

happy holidays @dgreif! I haven't seen it since the router restart.

A lot of people also have routers that self-update firmware, so wondering if the timing of these firmware updates/router brands has something to do with it.

DNS caching is causing the issue to permanently break the plugin once it gets a bad dns record

^^ I think this is the issue.

@dgreif
Copy link
Owner

dgreif commented Dec 26, 2020

@dxdc glad to hear it hasn't persisted. Looks like i'm currently resetting the DNS cache on ENOTFOUND and EREFUSED. I'll add ENETUNREACH to that list so that it doesn't permanently break until a restart.

@dxdc
Copy link
Author

dxdc commented Dec 26, 2020

@dgreif What about adding some kind of counter/timer to check for a certain number of failures before resetting the cache? My concern is in a case where it could result in persistent DNS hits every 5 seconds in the case that Ring blocked the connection for example.

And, sometimes these are caused by micro outages.

Or, is there a way to not store the 'bad' cached value in the case of a failed connection only? Maybe I'm overthinking it. Just want to avoid the situation where it does DNS lookups every 5 seconds on a "forever" type loop...

@thechrisreese
Copy link

@dgreif
Copy link
Owner

dgreif commented Jan 1, 2021

@dxdc I've always seen DNS lookups as a pretty light-weight operation. Besides blowing up some users pi-hole watchers, is there really much concern if the plugin does DNS lookups? I want to make it optimal, but I care more about preventing the plugin from breaking than a little extra network traffic.

@thechrisreese thanks for pointing out the eero info. Eero has been a major pain for live streaming, so no surprise if it is causing DNS issues as well 😅

@dgreif dgreif closed this as completed in c28b368 Jan 1, 2021
@dxdc
Copy link
Author

dxdc commented Jan 4, 2021

@dgreif I should have clarified! I don't care so much about the DNS lookups, more the pings to the Ring servers (resulting in failure) every 5 seconds. Not sure if that should continue on a forever-type basis.. maybe exponential backoff would be better? For instance, if a user changed their password. Anyway, just thinking about it.

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

7 participants