Ring: error undefined after install 9.4.0

Created on 5 Jul 2020  ·  49Comments  ·  Source: dgreif/ring

Bug Report

Describe the Bug

error undefined after install 9.4.0.
i try to get another token even if i had one since the beggining, but now the response is undefined if i try to install older version the response is the same.

To Reproduce

Steps to reproduce the behavior:

  • Start Homebridge
  • Attempt to ...
  • See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots/Logs

[7/5/2020, 7:31:13 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status undefined. Response body: undefined
[7/5/2020, 7:31:13 AM] [Ring] Error connecting to API
[7/5/2020, 7:31:13 AM] [Ring] Error: Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens
at RingRestClient.getGrantData (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:116:15)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:120:36)
at Generator.next ()
at /usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:27:71
at new Promise ()
at __awaiter (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:23:12)
at RingRestClient.getAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:119:16)
at RingRestClient.refreshAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:214:33)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:231:26)
at Generator.throw ()

Additional context

Add any other context about the problem here.

Homebridge Ring Config

Post homebridge-ring platform config _without sensitive information_

HIGHLIGHT THIS TEXT AND POST CONFIG HERE
DO NOT INCLUDE YOUR REFRESH TOKEN OR EMAIL/PASSWORD (replace them with xxx)

Environment

  • OS: mac catalina
  • Node.js: 14.0.0
  • NPM: 6.14.4
  • homebridge-ring:9.4.0
  • homebridge: 1.1.1
  • hoobs: [e.g. 0.4.50 or N/A]
bug

All 49 comments

Looks like you just need a new refresh token based on the next couple lines after the error

i've tried several times and always get the following error
Successfully logged in to Ring. Please add the following to your config:

"refreshToken": "undefined"

access via web is ok

tried with other ring 2fa programs like bulkring for downloading files and is working ok, only your plugin is not working, please help

Just to add I’m also experiencing the same issue since updating. I’ve
exhausted what I believe to be any potential faults on my server, network
and ring themselves. Ring control centre shows homebridge-ring as logged
in. Refreshed token several times and uninstalled/reinstalled plugin. Only
problem is with ring plugin, all others and instances working fine. So I’m
watching this thread with interest. If there’s anything I can assist with
please ask.

On Sun, 5 Jul 2020 at 10:47, divemasterjm notifications@github.com wrote:

tried with other ring 2fa programs like bulkring for downloading files and
is working ok, only your plugin is not working


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/dgreif/ring/issues/391#issuecomment-653866433, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AKEIYVHCPKT6LIKX4OJXHYLR2BD4RANCNFSM4OQWYK2Q
.

Ok, I need some clarification. Did you change your config and set "refreshToken": "undefined" in there? If so, that will definitely cause issues. undefined indicates that Ring did not actually provide a refresh token when you tried to fetch one with the auth cli. I'll start looking into why that situation could happen, but my guess is that Ring just had a bug on their end last night. You should rerun the auth cli and try to get a valid refresh token. The other option is to use homebridge-config-ui-x to get a new token. If you already have the ui installed, just go into your Ring settings and clear out the refresh token field. It will then walk you through the auth process and handle the config update for you.

Thanks for the reply, yeah I used the config UI-X to get refresh token.
I’ll take do as you suggest and let you know how I get on.

On Sun, 5 Jul 2020 at 15:00, Dusty Greif notifications@github.com wrote:

Ok, I need some clarification. Did you change your config and set "refreshToken":
"undefined" in there? If so, that will definitely cause issues. undefined
indicates that Ring did not actually provide a refresh token when you tried
to fetch one with the auth cli. I'll start looking into why that situation
could happen, but my guess is that Ring just had a bug on their end last
night. You should rerun the auth cli and try to get a valid refresh token.
The other option is to use homebridge-config-ui-x to get a new token. If
you already have the ui installed, just go into your Ring settings and
clear out the refresh token field. It will then walk you through the auth
process and handle the config update for you.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/dgreif/ring/issues/391#issuecomment-653892477, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AKEIYVBOCWWRBKXZLM2G62LR2CBRDANCNFSM4OQWYK2Q
.

i tried with config-ui-x, got token but
[7/5/2020, 5:08:22 PM] Homebridge is running on port 51828.
[7/5/2020, 5:08:23 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status undefined. Response body: undefined
[7/5/2020, 5:08:23 PM] [Ring] Error connecting to API
[7/5/2020, 5:08:23 PM] [Ring] Error: Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens
at RingRestClient.getGrantData (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:116:15)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:120:36)
at Generator.next ()
at /usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:27:71
at new Promise ()
at __awaiter (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:23:12)
at RingRestClient.getAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:119:16)
at RingRestClient.refreshAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:214:33)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:231:26)
at Generator.throw ()

@divemasterjm did you save the new config and reboot your homebridge server?

yes, the new token is saved in config.json and restarted, i double checke token and is on config.json

Can you try v9.3.4 and see if starts properly?

same error
[7/5/2020, 5:16:37 PM] Homebridge is running on port 51828.
[7/5/2020, 5:16:38 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status undefined. Response body: undefined
[7/5/2020, 5:16:38 PM] [Ring] Error connecting to API
[7/5/2020, 5:16:38 PM] [Ring] Error: Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens
at RingRestClient.getGrantData (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:107:15)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:111:36)
at Generator.next ()
at /usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:27:71
at new Promise ()
at __awaiter (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:23:12)
at RingRestClient.getAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:110:16)
at RingRestClient.refreshAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:205:33)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:188:26)
at Generator.throw ()

I'm fairly confident this is an issue with your config. If you are getting a valid refresh token (not "undefined"), then it should work just fine. Double check your config file and make sure your refreshToken is a long random string.

it is
{
"refreshToken": "xxxxxxxxxxxxxxxxxxxxxpbnRlcm5hbC9qd2tzIiwia2lkIjoiZGVmYXVsdCIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1OTM5NjIzMjcsInJlZnJlc2hfY2lkIjoicmluZ19vZmZpY2lhbF9hbmRyb2lkIiwicmVmcmVzaF9zY29wZXMiOlsiY2xpZW50Il0sInJlZnJlc2hfdXNlcl9pZCI6MTc2Njg3MTAsInJuZCI6ImFrdVg1MTAtRmRGczVnIiwic2Vzc2lvbl9pZCI6IjcxZjU1Y2YyLTgwYzAtNGRiYi05NjZmLTEwNWQ1ZTgwN2ZmYyIsInR5cGUiOiJyZWZyZXNoLXRva2VuIn0.91MlE6l2HrOyYWHKZFg_zVvRX4Duo7fbI2NwCVgoHdhAFkFwXGJsHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"hideLightGroups": true,
"hideCameraSirenSwitch": false,
"hideInHomeDoorbellSwitch": false,
"hideAlarmSirenSwitch": false,
"locationModePollingSeconds": 0,
"platform": "Ring"
}

is a single line

Yeah, that looks correct. Try adding "debug": true and running it again. Then it will log a little more info when the http request fails

[7/5/2020, 5:25:33 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status undefined. Response body: undefined
[7/5/2020, 5:25:33 PM] [Ring] Error connecting to API
[7/5/2020, 5:25:33 PM] [Ring] Error: Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens
at RingRestClient.getGrantData (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:107:15)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:111:36)
at Generator.next ()
at /usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:27:71
at new Promise ()
at __awaiter (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:23:12)
at RingRestClient.getAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:110:16)
at RingRestClient.refreshAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:205:33)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:188:26)
at Generator.throw ()

That didn't add anything, which means the debug flag might not have been picked up... Maybe you have multiple config files somehow?

what do you mean? in this homebridge instace is the only plug in setted up

I mean you may be editing one config.json file, but homebridge is using a different file when it starts up. That's the only explaination I can think of since changes to your config.json don't seem to be taking effect.

I didnt touch anything since long ago, everything was runing ok till i update this morning

"hideLightGroups": true,
"debug": true,
"hideCameraSirenSwitch": false,
"hideInHomeDoorbellSwitch": false,
"hideAlarmSirenSwitch": false,
"locationModePollingSeconds": 0,
"platform": "Ring"
}

I'm not sure what may have gone wrong, but if v9.3.4 doesn't work for you either, then it isn't something that I broke in the plugin. You could try going back a few more versions if you were not on 9.3.4 previously. If you can't get any previous versions to work, then the issue is definitely somewhere in your setup. I completely believe you when you say you didn't do anything other than update, but something may have gotten messed up in the process.

i was on 9.3.4, i tried this morning with 9.3.0, reboot mac, i dont know what else to do, also rechecked launched to see if is getting the right path, and everything is ok, in same mac, bulkring is working fine

i removed plugin config and rebooted, no accesory found, thats means is getting right config file.

Yeah, I take back what I said about the duplicate config.json. I thought debug would add extra logging, but apparently it doesn't for that specific code path. Sorry! Regardless, I'm still not sure how to proceed if the refresh token you have in there is valid and it is giving you that error. I'll keep digging a bit more.

thanks, waiting for your response

moved to another instance and same results
[7/5/2020, 5:53:13 PM] Homebridge is running on port 51888.
[7/5/2020, 5:53:14 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status undefined. Response body: undefined
[7/5/2020, 5:53:14 PM] [Ring] Error connecting to API
[7/5/2020, 5:53:14 PM] [Ring] Error: Refresh token is not valid. Unable to authenticate with Ring servers. See https://github.com/dgreif/ring/wiki/Refresh-Tokens
at RingRestClient.getGrantData (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:107:15)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:111:36)
at Generator.next ()
at /usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:27:71
at new Promise ()
at __awaiter (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:23:12)
at RingRestClient.getAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:110:16)
at RingRestClient.refreshAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:205:33)
at RingRestClient. (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:188:26)
at Generator.throw ()

@divemasterjm unfortunately I'm out of time to work on Ring for today. It's possible that it's a rate limiting issue and that it will work if you try again tomorrow. I'm really not sure what else would be causing this issue since you are having problems on older versions and your refresh token seems completely valid.

still facing the same problem even with ring cli and the ui.

@fahaad9 To clarify, you are getting ‘undefined’ when you try to get a new refresh token? I am not able to reproduce that issue on my end so I’m not sure what the next step is. If someone seeing this issue can debug it, please let me know

After 9.4.1, same error
tried to delete also persist and accessories directories, but nothing same problem

Also no joy for me after 9.4.1
ring-auth-cli returns refreshToken undefined.
Using the config-UI does give a refresh token and updates the ring plugin config but the same error on startup occurs.
Also deleted persist and accessories plus the plugin itself and reinstalled, with same result.
Any guidance will be greatly appreciated. Thanks in advance.

https://status.ring.com/incidents/ps54tsbpw7ny - Ring is currently having issues with their authentication. This issue could have started on their end. We'll see what happens after they get it fixed today

Ring state that the authentication issue has been resolved. I unlinked my account from the plugin and linked back with new token, but same error.

@Gazza132 which version of node are you on? If it is 11 or 14, please install LTS (12.18.2) and try again

same here, still having undefined error

I was on node v14.1.0, installed LTS version, uninstalled ring plugin and
reinstalled. I now have ring plugin working. Thank you very much for your
help.
Am I to remain on the LTS node version for the foreseeable future?

On Tue, 7 Jul 2020 at 21:53, divemasterjm notifications@github.com wrote:

same here, still having undefined error


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dgreif/ring/issues/391#issuecomment-655128181, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AKEIYVCFW55O53P5E7FWJFLR2ODNTANCNFSM4OQWYK2Q
.

@Gazza132 I just tried 14.0.0, 14.1.0 and 14.5.0. All worked flawlessly for auth-cli and with homebridge. I'm really not sure what caused these issues but it may have been some oddity in your npm modules. Do you mind switching to 14.5.0 and giving it a try?

@dgreif i am on v14.0.0 and still the same error. doesnt seem to work. I even restarted my server as well!

oka i upgraded to 14.5.0 and it seems to be working fine now!

@divemasterjm please try node 14.5.0 or 12.18.2. If that works, we should be good to close this issue

Ive installed 14.5.0 and now i dont have the error but i can see the camera on homekit (((

Can or can’t see the camera? Any new logs showing errors?

no errors, just the camera is in homebridge but homekit can't find accesory

v14.5.1 installed and everything working as it should, cameras and alarm.

[7/8/2020, 8:02:27 AM] Homebridge is running on port 51828.
[7/8/2020, 8:02:30 AM] [Ring] Configuring 1 cameras and 1 devices for location "xxxxxxx" - locationId: xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
[7/8/2020, 8:02:30 AM] [Ring] Adding new accessory doorbell_v3 Puerta principal

Apologies v14.5.0, installed.

any ideas or help please?

just reset my homebridge instance and is working back again, thanks for your help to all

Yes, thank you all for the time and effort it’s taken to resolve this problem. Now more knowledgeable and better able to trouble shoot.

Was this page helpful?
0 / 5 - 0 ratings