GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Datastore emulator fails to start without project id property · Issue #355 · googleapis/java-datastore

This repository was archived by the owner on Feb 24, 2026. It is now read-only.
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Datastore emulator fails to start without project id property #355

Copy link
Copy link
Closed
#923
Closed
Datastore emulator fails to start without project id property#355
#923
Copy link
Assignees
jainsahab
Labels
🚨This issue needs some love.api: datastoreIssues related to the googleapis/java-datastore API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@artemptushkin
artemptushkin
opened on Mar 1, 2021
Issue body actions

Environment details

  1. GCloud datastore emulator 2.1.0
  2. Google Cloud SDK 327.0.0
  3. OS type and version: NAME="Ubuntu" VERSION="18.04.4 LTS (Bionic Beaver)" / MacOS Catalina 10.15.7 (19H15)
  4. Java version: OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) / OpenJDK Runtime Environment (build 11.0.7+10)
  5. 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

  1. 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

  1. Why LocalDatastoreHelper doesn't pass --project on startup and doesn't expect this from the builder?
  2. 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.

Activity

  1. product-auto-label
    added
    api: datastoreIssues related to the googleapis/java-datastore API.
    on Mar 1, 2021
  2. yoshi-automation
    added
    triage meI really want to be triaged.
    on Mar 2, 2021
  3. dmahugh
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: questionRequest for information or clarification. Not an issue.
    on Mar 5, 2021
  4. dmahugh
    assigned
    crwilcox
    on Mar 5, 2021
  5. yoshi-automation
    removed
    triage meI really want to be triaged.
    on Mar 5, 2021
  6. yoshi-automation
    added
    🚨This issue needs some love.
    and removed
    🚨This issue needs some love.
    on Jun 3, 2021
  7. crwilcox
    removed their assignment
    on Sep 21, 2021
  8. yoshi-automation
    added
    🚨This issue needs some love.
    on Nov 3, 2021
  9. meredithslota commented on Nov 15, 2021

    @meredithslota
    meredithslota
    on Nov 15, 2021
    More actions

    I wonder if this is an issue with out-dated documentation — https://cloud.google.com/sdk/gcloud/reference/beta/emulators/datastore/start also declares that the--project flag isn't required, but maybe it is now. Are you setting the variables re: the env-init command? It seems like it's expecting a variable like this: DATASTORE_PROJECT_ID=my-project-id (as per this page: https://cloud.google.com/datastore/docs/tools/datastore-emulator#automatically_setting_the_variables).

  10. meredithslota
    removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    🚨This issue needs some love.
    on Nov 15, 2021
  11. artemptushkin commented on Nov 16, 2021

    @artemptushkin
    artemptushkin
    on Nov 16, 2021
    Author
    More actions

    @meredithslota I question here particularly LocalDatastoreHelper class and troubleshooting on its start-up issues.

    Consider it starts in an isolated environment without any env variable predefined, then LocalDatastoreHelper starts finishes but the method caller never knows that it failed to start due to missing an env variable, there is no log message.

    As well there is no method in builder to pass the project id explicitly
    image

    I propose:

    • add a method to the builder to pass the project id (if project id is optional it's still good to let you class consumers to pass its value)
    • log when it fails to start due to missing env variable with a reasoning message

    It will make it clear as right now there is no clue to know why it failed to start when no env variable has been provided.

  12. meredithslota
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    type: questionRequest for information or clarification. Not an issue.
    on Jun 27, 2022
  13. yoshi-automation
    added
    🚨This issue needs some love.
    on Jun 27, 2022
  14. meredithslota
    assigned
    prash-mi
    on Oct 10, 2022
  15. meredithslota commented on Oct 10, 2022

    @meredithslota
    meredithslota
    on Oct 10, 2022
    More actions

    There's a similar issue with the LocalDatastoreHelper googleapis/google-cloud-java#12002 — @prash-mi can you include this with your investigation of the other issue?

  16. jainsahab
    assigned
    jainsahab
    and unassigned
    prash-mi
    on Oct 11, 2022
  17. jainsahab commented on Nov 23, 2022

    @jainsahab
    jainsahab
    on Nov 23, 2022
    Contributor
    More actions

    @artemptushkin , Thanks for reporting this.

    We have fixed this issue in this PR and is up for review. You can find the explanation and fix in the PR itself.

    Reacted by Artem Ptushkin
  18. jainsahab
    closed this as completedin #923on Dec 1, 2022
  19. jainsahab
    added a commit that references this issue on Dec 1, 2022

    fix: #355 Explicitly passing --project argument when starting emulator (

    This issue will close once commit ef4065d is merged into the 'main' branch.
    ef4065d
  20. gcf-merge-on-green
    added a commit that references this issue on Dec 6, 2022

    chore(main): release 2.13.0 (#921)

    34868fe
  21. triplequark
    added a commit that references this issue on Dec 19, 2022

    chore: sync with main (#941)

    This issue will close once commit 26e6733 is merged into the 'main' branch.
    26e6733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jainsahab
    jainsahab

Labels

🚨This issue needs some love.api: datastoreIssues related to the googleapis/java-datastore API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.