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:
- Created a year ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 can some of the lib authors please elaborate on this one?
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!