Project ID required even if running script from Compute Engine
See original GitHub issuevar datastore = require('@google-cloud/datastore')();
The line above used on compute engine (not app engine) will still throw the error below -
[Error: Sorry, we cannot connect to Google Cloud Services without a project ID. You may specify one with an environment variable named "GCL
OUD_PROJECT". See https://googlecloudplatform.github.io/google-cloud-node/#//docs/guides/authentication for a detailed guide on creating an
authenticated connection.]
Yet in the documentation it says -
If you are running your app on Google Compute Engine, you won’t need to worry about supplying connection configuration options to @google-cloud/datastore— we figure that out for you.
That is not the case.
To reproduce create a google Compute engine instance and run a node.js script without a supplied project ID it will fail.
Issue Analytics
- State:
- Created 7 years ago
- Comments:25 (16 by maintainers)
Top Results From Across the Web
Using startup scripts on Linux VMs - Google Cloud
A startup script is a file that performs tasks during the startup process of a virtual machine (VM) instance. Startup scripts can apply...
Read more >trying to find the current project id of the deployed python ...
I need to get the project-id through code to find out where it is deployed. I write a small python 3.7 script and...
Read more >Google Cloud projects | Apps Script
Open the Google Cloud console Manage Resources page. Next to the Apps Script folder, copy the ID.
Read more >google_project | Resources | hashicorp/google
Allows creation and management of a Google Cloud Platform project. ... The user or service account that is running Terraform when creating a...
Read more >Get started with Cloud Firestore - Firebase
If you haven't already, create a Firebase project: In the Firebase ... your App Engine app (which is required if you use Cloud...
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 Free
Top 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
Getting this with 0.48.0 on App Engine nodejs runtime.
var gcloud = require('google-cloud')({ projectId: 'my-project-id-here', keyFilename: './keyfile.json' });
Log error when trying to access gcs bucket:
EDIT: Reverting to:
resolves issue with no changes to code.
EDIT 2: Also resolved by:
@stephenplusplus Is this a release blocking issue? It looks like several users have encountered it.