question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Refresh token is not valid

See original GitHub issue

Howdy, friends; I’m having some trouble getting Ring working with Homebridge. I used the ring-auth-cli command (slick tool! nice work ✨) to generate a refreshToken, and it appears to have succeeded, but I get this error when I start up Homebridge:

[1/13/2020, 7:48:54 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed
[1/13/2020, 7:48:54 PM] [Ring] Error connecting to API
[1/13/2020, 7:48:54 PM] [Ring] Error: Refresh token is not valid.  Unable to authenticate with Ring servers.
    at RingRestClient.getGrantData (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:85:15)
    at RingRestClient.<anonymous> (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:89:36)
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:4:12)
    at RingRestClient.getAuth (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:88:16)
    at RingRestClient.<anonymous> (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:113:33)
    at Generator.throw (<anonymous>)
    at rejected (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:6:65)

Just to be safe, I generated another refreshToken, but I’m still getting the same error. Am I just doing something silly?

Versions:

  • homebridge: 0.4.50
  • homebridge-ring 5.13.0
  • node v13.6.0
  • host OS: macOS Catalina 10.15.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shinypbcommented, Jan 19, 2020

OK, you’re gonna love this: the refreshToken error is a red herring. The real problem was showing up in homebridge’s error log above that:

[1/19/2020, 2:37:40 PM] [Ring] Error connecting to API
[1/19/2020, 2:37:40 PM] [Ring] Error: Error while obtaining machine id: Error: Command failed: ioreg -rd1 -c IOPlatformExpertDevice
/bin/sh: ioreg: command not found

Homebridge is running on my Mac via launchd, and—surprise!—/usr/sbin wasn’t on the PATH I’d configured. I’ve opened up a pull request against the node-machine-id package that homebridge-ring uses to make it specify a full path to the ioreg command. If it gets merged, I’ll open a PR up against this project to update the dependency.

Thanks for the troubleshooting help! ✌️

1reaction
shinypbcommented, Jan 18, 2020

Sure, happy to do so. I’m away from my computer until tomorrow; stay tuned.

On Sat, Jan 18, 2020 at 9:31 AM Dusty Greif notifications@github.com wrote:

@shinypb https://github.com/shinypb after reviewing your original post, I now realize this wasn’t an issue with your refresh token at all, sorry for wasting your time on that! I’ve added some additional logging in v 6.0.3 to help pin down the issue. Would you mind updating and posting the new error logs? Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dgreif/ring/issues/225?email_source=notifications&email_token=AAAKFNRTJUPLHARKILYQSVDQ6M4HDA5CNFSM4KGMQSQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJJ5XEY#issuecomment-575921043, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAKFNS6SB2ALAQTJDUL2WLQ6M4HDANCNFSM4KGMQSQQ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

What causes "Invalid Refresh Token" errors? - Auth0 Community
This means that all other refresh tokens issued to the same combination of application, user and audience effectively become invalid.
Read more >
Expired Refresh Token Causes an Invalid Token Error
The refresh token expires after 90 days of inactivity. Microsoft also reserves the right to expire the token at any time for security...
Read more >
How to find what is causing "Invalid Refresh Token" on Identity ...
1 Answer. Save this answer. Show activity on this post. If the RefreshTokenUsage client configuration is set to OneTime use (the default), if ......
Read more >
Refresh token not working. - Constant Contact Community
The two most common reasons for expired refresh token errors are: 1) When you refresh, you get both a new access token and...
Read more >
Solved: Refresh token invalid - Fitbit Community
Each time you refresh your token, your application will receive a new access token and new refresh token. You'll need to store the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found