Closed
Description
Environment details
- GCloud datastore emulator 2.1.0
- Google Cloud SDK 327.0.0
- OS type and version: NAME="Ubuntu" VERSION="18.04.4 LTS (Bionic Beaver)" / MacOS Catalina 10.15.7 (19H15)
- Java version: OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) / OpenJDK Runtime Environment (build 11.0.7+10)
- Libs:
- https://github.com/GoogleCloudPlatform/spring-cloud-gcp:
org.springframework.cloud:spring-cloud-gcp-starter-data-datastore:1.2.5.RELEASE
, I checked - same with the latest google-cloud-datastore:1.104.0
google-cloud-core:1.93.7
Steps to reproduce
This version emulator fails to start without --project
property
gcloud beta emulators datastore start
ERROR: (gcloud.beta.emulators.datastore.start) The required property [project] is not currently set.
You may set it for your current workspace by running:
$ gcloud config set project VALUE
or it can be set temporarily by the environment variable [CLOUDSDK_CORE_PROJECT]
Starting emulator with Java code like this:
LocalDatastoreHelper.create(settings.getConsistency(), settings.getPort());
Causes: no messages in logs, the application failed to call the Datastore then with I/O exceptions, i.e. curl doesn't work.
Workaround
Set env variable: CLOUDSDK_CORE_PROJECT
with the projectId value
Questions
- Why
LocalDatastoreHelper
doesn't pass--project
on startup and doesn't expect this from the builder? - Shouldn't
LocalDatastoreHelper #start
fail to start on this kind of errors?
Besides the outcomes of these questions, I would expect this class to fail to start or log something.