GCLOUD_PROJECT is deprecared in favor of GOOGLE_CLOUD_PROJECT + avoid using it at all
See original GitHub issueThe sample relies on the GCLOUD_PROJECT
environment variable (see https://github.com/GoogleCloudPlatform/nodejs-getting-started/blob/master/2-structured-data/config.js#L27)
However, this variable is now deprecated and is not present in newer versions of the Node.js runtimes for App Engine.
Instead, developers should rely on the GOOGLE_CLOUD_PROJECT
environment variable.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Using Environment Variables | Cloud Functions Documentation
GCLOUD_PROJECT, Reserved: The current GCP project ID (deprecated). GOOGLE_CLOUD_PROJECT, Reserved: Not set but reserved for internal use.
Read more >How can I get current projectId inside Google Cloud Functions?
Current docs say GCP_PROJECT is the current env var, and that GCLOUD_PROJECT is deprecated. Not sure if you try now, whether the emulator...
Read more >Configure your environment | Cloud Functions for Firebase
This approach makes configuration values available both at runtime and deploy time, and deployment is blocked unless all parameters have a valid value....
Read more >Google Cloud (GCP) Classic Installation & Configuration
To configure Pulumi to interact with your Google Cloud project, set it with the pulumi config command using the project's ID:.
Read more >gcloud app deploy force
Open up a Google Cloud project in the Google Cloud Console and enable the Kubernetes Engine API (as described in Deploying a containerized...
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
google-auth-library (for Node.js) forks a process to run
gcloud config
to get the project ID, and last I looked, it prioritizes that over using the metadata server:https://github.com/googleapis/google-auth-library-nodejs/blob/37bb8c7cd0a6501103274284d9cddd6816cc881e/src/auth/googleauth.ts#L177-L182
Forking a process isn’t safe on Linux because of https://github.com/nodejs/node/issues/25382; we routinely get crashes from the GCP client libs. I think that should be addressed before Google globally recommends not using an env var. An env var is also faster than making a req to the metadata server.
Obsolete with planned rewrite of the tutorial.