11
votes

I've been experimenting for a while with Firebase Cloud Functions, today I made a minor change to my index.json file (added a field to a document to be set), after deploying on the Firebase Console > Functions > Logs I've got this weird errors:

Auth error:Error: Could not refresh access token.

and:

Error: 16 UNAUTHENTICATED: Getting metadata from plugin failed with error: Could not refresh access token.
at new createStatusError (/user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:65:15)
at /user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:568:15

Here's a list of things I tried but did not work:

  1. revert the change in index.json
  2. deploy every function (made the problem worse, now none of my cloud functions is working)
  3. generate a new keyFilename for @google-cloud/storage
  4. npm update firebase-admin
  5. (rebooting)

The last time I did a firebase deploy successfully was last night. I'm on linux.

Thank you.

2
Thanks for linking that, unfortunately the file they suggest to delete does not exist on my system.ran3000
Myself and a few other developers who encountered issue this afternoon commented there.Kyle Hotchkiss
These errors started for me between 12:35 and 12:45 pm (today 1/31/2018) as displayed in my logs. I hope this isn't related to the Super Blue Blood Moon we've had today!aero
status.firebase.google.com/incident/Functions/18011 is the status page tracking the incidentIan Barber

2 Answers

7
votes

Thanks everyone for the reports, both here and especially also via our tech support channels - these really help.

We believe the issue to have been caused by a problem deep in our Node.js dependency chain, in particular for users of Firestore. We've just released https://www.npmjs.com/package/google-gax 0.14.5 to address the issue. Please:

  • Either wait for the npm caches to pick up the new version, or explicitly request google-gax 0.14.5 in your package.json.
  • Re-deploy your functions.

That should resolve things. If you're still having trouble, please let us know!

3
votes

Our current suspicion is that a very nested dependency had a breaking change that didn't follow semver. We're investigating and hope to have a fix soon. When this fix rolls out, you'll only have to redeploy.