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.

Refresh token expiring? Error: 16 UNAUTHENTICATED: Failed to retrieve auth metadata with error: invalid_grant

See original GitHub issue
  code: 16,
  details: 'Failed to retrieve auth metadata with error: invalid_grant',
  metadata: Metadata { internalRepr: Map(0) {}, options: {} },
  note: 'Exception occurred in retry method that was not classified as transient'

It seems like this keeps happening every week or so, and I need to go through the process of getting a new refresh token every time from here, which then fixes the issue.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mkosikcommented, Oct 1, 2022

+1 can some of the lib authors please elaborate on this one?

0reactions
avermeilcommented, Dec 13, 2022

Hi @sgpascoe – The refresh token helper tool is meant as a quick way to get started, not really as a permanent solution 😃

That said, based on Google Support’s response, it sounds like you’ll get longer-lived tokens if you change your Google Project’s publishing status (likely the one associated with the client_id you’re using in the helper tool).

Consider checking the helper tool’s source code – it shows just how simple it is to get new tokens. Certainly much faster than setting up a puppeteer scraper!

Read more comments on GitHub >

github_iconTop Results From Across the Web

16 UNAUTHENTICATED: Failed to retrieve auth metadata ...
I faced the same error, it was a authentication issue due to credentials. Below command fixed it for me. gcloud auth application-default ...
Read more >
Failed to retrieve auth metadata with error: invalid_grant
One of the possible reasons for invalid_grant error is when your refresh token has been expired or revoked. Please note that a Google...
Read more >
Google OAuth “invalid_grant” nightmare — and how to fix it
The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, ...
Read more >
Getting metadata from plugin failed with error: invalid_grant
Trying to get a firestore doc in HTTP cloud functions returns this error in the local emulator ( firebase serve --only functions )....
Read more >
How i fixed "Getting metadata from plugin failed with error
Solution. This error means that you don't have a JSON file with service account key OR your session with the path was expired....
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