googlearchive / cloud-functions-emulator

A local emulator for deploying, running, and debugging Google Cloud Functions.
https://github.com/GoogleCloudPlatform/cloud-functions-emulator/wiki
Apache License 2.0
826 stars 114 forks source link

Default credentials are not checking project API enablement #104

Open mbleigh opened 7 years ago

mbleigh commented 7 years ago

Description

When trying to use Google Cloud node libraries with default credentials, an error occurs when trying to use e.g. Vision API:

error: Error: Google Cloud Vision API has not been used in project google.com:cloudsdktool before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/vision

.googleapis.com/overview?project=google.com:cloudsdktool then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. at /.../functions/node_modules/grpc/src/node/src/client.js:434:17

It seems like the credentials should be generated such that API enablement is checked against the target project for emulation, not the cloudsdktool project.

Steps to reproduce

  1. Install e.g. @google-cloud/vision API and initialize with default credentials.
  2. Run HTTPS emulation via Firebase CLI.
  3. See error when trying to use Vision API.

Thanks!

jmdobry commented 7 years ago

This error should be reported on the issue tracker for the Cloud SDK

merlinnot commented 5 years ago

Was this issue ever reported? It's been over a year and this is still not fixed.

merlinnot commented 5 years ago

I've created one: https://issuetracker.google.com/issues/120462217