11

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.

ran3000
  • 186
  • 1
  • 13

2 Answers2

7

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!

Robert-Jan Huijsman
  • 1,914
  • 12
  • 9
3

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.

Thomas Bouldin
  • 3,707
  • 19
  • 21