0
votes

Following the instructions from https://firebase.google.com/docs/functions/local-emulator

I have

  1. Generated and downloaded a key for the service account for the project

  2. Set the path with "set GOOGLE_APPLICATION_CREDENTIALS=(full path to a json file)"

  3. Started the emulator with "firebase emulators:start --only functions"

So far so good, but when I attempt to call an endpoint with Postman, I receive the following error message on repeat until the call times out.

[2019-06-25T04:34:54.039Z] @firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential","message":"Credential implementation provided to initializeApp() via the \"credential\" property failed to fetch a valid Google OAuth2 access token with the following error: \"Error fetching access token: Error while making request: getaddrinfo ENOTFOUND metadata.google.internal metadata.google.internal:80. Error code: ENOTFOUND\"."}

1
If you're having a problem with the Firebase CLI, please file a bug report on its GitHub, and be sure to give full reproduction steps that anyone can use to observe the problem. github.com/firebase/firebase-toolsDoug Stevenson

1 Answers

0
votes

I had the same error and I solved using the --only options like:

firebase serve --only hosting

then you can access your API via http://localhost:5000