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 — fix: #355 Explicitly passing --project argument when starting emulator by jainsahab · Pull Request #923 · googleapis/java-datastore

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

Conversation

@jainsahab

@jainsahab jainsahab commented Nov 21, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

fix #355

Context:
LocalDatastoreHelper starts a subprocess gcloud beta emulators datastore start to start the emulator, It is always starting the subprocess under the assumption that user have already set the project id property using gcloud config set project some-project-id. If the project-id property is set, it'll result in successful execution of sub-process. Otherwise it'll throw the following error.

➜  java-datastore git:(main) gcloud beta emulators datastore start
WARNING: Reusing existing data in [/Users/jainsahab/.config/gcloud/emulators/datastore].
Executing: /Users/jainsahab/Work/bin/google-cloud-sdk/platform/cloud-datastore-emulator/cloud_datastore_emulator start --host=::1 --port=8045 --store_on_disk=True --allow_remote_shutdown --consistency=0.9 /Users/jainsahab/.config/gcloud/emulators/datastore
ERROR: (gcloud.beta.emulators.datastore.start) The required property [project] is not currently set.
It can be set on a per-command basis by re-running your command with the [--project] flag.

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]

Note: To unset the project-id property, run gcloud config unset project

BlockingProcessStreamReader.java file from google-cloud-core library which is a java Thread ignores this helpful text and the subprocess's exit code to silently completes its own execution. Hence, no error was given to the user.

Solution:
As part of this PR, google-cloud-core library (covered in this PR) is out of scope, but we are explicitly passing --project argument now while starting the emulator so that it no longer expect the project-id property to set.
In addition to that, we are also giving the user the capability to set a custom project Id.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jainsahab added 2 commits November 21, 2022 18:35
@jainsahab
Running gcloud datastore emulator with --project argument
3b458dd
@jainsahab
Allow user to pass a custom project id when creating a new LocalDatas…
a17b980
…toreHelper instance
@jainsahab
jainsahab requested review from a team November 21, 2022 13:28
@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: datastore Issues related to the googleapis/java-datastore API. labels Nov 21, 2022
@jainsahab

jainsahab commented Nov 22, 2022

Copy link
Copy Markdown
Contributor Author

PR for the issue in google-cloud-core library is up for review too @ googleapis/java-core#1039.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jainsahab jainsahab mentioned this pull request Nov 23, 2022
Datastore emulator fails to start without project id property #355
Closed
artemptushkin
artemptushkin approved these changes Nov 23, 2022
View reviewed changes
@jainsahab jainsahab changed the title fix: #355 Explicitly passing --process argument when starting emulator fix: #355 Explicitly passing --project argument when starting emulator Nov 23, 2022
kolea2
kolea2 suggested changes Nov 23, 2022
View reviewed changes
Comment thread ...e-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jainsahab
Creating a local variable to increase the readability and emphasizing…
8278620
… on the fact that project id not nullable now
kolea2
kolea2 approved these changes Nov 30, 2022
View reviewed changes
@jainsahab jainsahab added the owlbot:run Add this label to trigger the Owlbot post processor. label Dec 1, 2022
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Dec 1, 2022
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
8d8c107
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@jainsahab
jainsahab merged commit ef4065d into googleapis:main Dec 1, 2022
@release-please release-please Bot mentioned this pull request Dec 1, 2022
chore(main): release 2.13.0 #921
Merged
gcf-merge-on-green Bot pushed a commit that referenced this pull request Dec 6, 2022
@release-please
chore(main): release 2.13.0 (#921)
34868fe
🤖 I have created a release *beep* *boop*
---


## [2.13.0](https://togithub.com/googleapis/java-datastore/compare/v2.12.5...v2.13.0) (2022-12-06)


### Features

* Next release from main branch is 2.13.0 ([#917](https://togithub.com/googleapis/java-datastore/issues/917)) ([1f12435](https://togithub.com/googleapis/java-datastore/commit/1f1243577cbdc206b6a0bfcde818411eb1b806ad))


### Bug Fixes

* [#355](https://togithub.com/googleapis/java-datastore/issues/355) Explicitly passing --project argument when starting emulator ([#923](https://togithub.com/googleapis/java-datastore/issues/923)) ([ef4065d](https://togithub.com/googleapis/java-datastore/commit/ef4065d233b968f58a34673aa53d39f60a013e2d))


### Dependencies

* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#932](https://togithub.com/googleapis/java-datastore/issues/932)) ([1dbcea7](https://togithub.com/googleapis/java-datastore/commit/1dbcea73827961148800c1ec8e87065dbceb6c88))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 ([#924](https://togithub.com/googleapis/java-datastore/issues/924)) ([625e896](https://togithub.com/googleapis/java-datastore/commit/625e89685172ae546a813f5f7184223d01fbb0ac))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#930](https://togithub.com/googleapis/java-datastore/issues/930)) ([77285be](https://togithub.com/googleapis/java-datastore/commit/77285be97fbd6bca1ada35202842238e306dd8dc))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#925](https://togithub.com/googleapis/java-datastore/issues/925)) ([0c7539d](https://togithub.com/googleapis/java-datastore/commit/0c7539d736ec993d7bb0531d7cd4dab1b08487a0))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#931](https://togithub.com/googleapis/java-datastore/issues/931)) ([40b4011](https://togithub.com/googleapis/java-datastore/commit/40b4011e3a826a91e33541efdecb05f0e129f87c))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
triplequark pushed a commit that referenced this pull request Dec 19, 2022
@kolea2 @gcf-owl-bot
@jainsahab @renovate-bot @release-please @dependabot @chingor13
chore: sync with main (#941)
26e6733
* chore: upgrade native image checks to graalvm-22.3.0  (#1718) (#926)

chore: upgrade native image checks to graalvm-22.3.0
Source-Link: googleapis/synthtool@5e52896
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:27b1b1884dce60460d7521b23c2a73376cba90c0ef3d9f0d32e4bdb786959cfd

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>

* chore: add new branch to sync-repo-settings (#927)

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

* Running gcloud datastore emulator with --project argument

* Allow user to pass a custom project id when creating a new LocalDatastoreHelper instance

* Creating a local variable to increase the readability and emphasizing on the fact that project id not nullable now

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>

* build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.5 (#929)

* deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 (#931)

* deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 (#930)

* deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 (#932)

* chore(main): release 2.13.0 (#921)

:robot: I have created a release *beep* *boop*
---


## [2.13.0](https://togithub.com/googleapis/java-datastore/compare/v2.12.5...v2.13.0) (2022-12-06)


### Features

* Next release from main branch is 2.13.0 ([#917](https://togithub.com/googleapis/java-datastore/issues/917)) ([1f12435](https://togithub.com/googleapis/java-datastore/commit/1f1243577cbdc206b6a0bfcde818411eb1b806ad))


### Bug Fixes

* [#355](https://togithub.com/googleapis/java-datastore/issues/355) Explicitly passing --project argument when starting emulator ([#923](https://togithub.com/googleapis/java-datastore/issues/923)) ([ef4065d](https://togithub.com/googleapis/java-datastore/commit/ef4065d233b968f58a34673aa53d39f60a013e2d))


### Dependencies

* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#932](https://togithub.com/googleapis/java-datastore/issues/932)) ([1dbcea7](https://togithub.com/googleapis/java-datastore/commit/1dbcea73827961148800c1ec8e87065dbceb6c88))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 ([#924](https://togithub.com/googleapis/java-datastore/issues/924)) ([625e896](https://togithub.com/googleapis/java-datastore/commit/625e89685172ae546a813f5f7184223d01fbb0ac))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#930](https://togithub.com/googleapis/java-datastore/issues/930)) ([77285be](https://togithub.com/googleapis/java-datastore/commit/77285be97fbd6bca1ada35202842238e306dd8dc))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#925](https://togithub.com/googleapis/java-datastore/issues/925)) ([0c7539d](https://togithub.com/googleapis/java-datastore/commit/0c7539d736ec993d7bb0531d7cd4dab1b08487a0))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#931](https://togithub.com/googleapis/java-datastore/issues/931)) ([40b4011](https://togithub.com/googleapis/java-datastore/commit/40b4011e3a826a91e33541efdecb05f0e129f87c))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).

* chore(deps): update dependency com.google.cloud:google-cloud-datastore to v2.13.0 (#935)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-datastore](https://togithub.com/googleapis/java-datastore) | `2.12.5` -> `2.13.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datastore/2.13.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datastore/2.13.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datastore/2.13.0/compatibility-slim/2.12.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datastore/2.13.0/confidence-slim/2.12.5)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-datastore</summary>

### [`v2.13.0`](https://togithub.com/googleapis/java-datastore/blob/HEAD/CHANGELOG.md#&#8203;2130-httpsgithubcomgoogleapisjava-datastorecomparev2125v2130-2022-12-06)

[Compare Source](https://togithub.com/googleapis/java-datastore/compare/v2.12.5...v2.13.0)

##### Features

-   Next release from main branch is 2.13.0 ([#&#8203;917](https://togithub.com/googleapis/java-datastore/issues/917)) ([1f12435](https://togithub.com/googleapis/java-datastore/commit/1f1243577cbdc206b6a0bfcde818411eb1b806ad))

##### Bug Fixes

-   [#&#8203;355](https://togithub.com/googleapis/java-datastore/issues/355) Explicitly passing --project argument when starting emulator ([#&#8203;923](https://togithub.com/googleapis/java-datastore/issues/923)) ([ef4065d](https://togithub.com/googleapis/java-datastore/commit/ef4065d233b968f58a34673aa53d39f60a013e2d))

##### Dependencies

-   Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#&#8203;932](https://togithub.com/googleapis/java-datastore/issues/932)) ([1dbcea7](https://togithub.com/googleapis/java-datastore/commit/1dbcea73827961148800c1ec8e87065dbceb6c88))
-   Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 ([#&#8203;924](https://togithub.com/googleapis/java-datastore/issues/924)) ([625e896](https://togithub.com/googleapis/java-datastore/commit/625e89685172ae546a813f5f7184223d01fbb0ac))
-   Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#&#8203;930](https://togithub.com/googleapis/java-datastore/issues/930)) ([77285be](https://togithub.com/googleapis/java-datastore/commit/77285be97fbd6bca1ada35202842238e306dd8dc))
-   Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#&#8203;925](https://togithub.com/googleapis/java-datastore/issues/925)) ([0c7539d](https://togithub.com/googleapis/java-datastore/commit/0c7539d736ec993d7bb0531d7cd4dab1b08487a0))
-   Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#&#8203;931](https://togithub.com/googleapis/java-datastore/issues/931)) ([40b4011](https://togithub.com/googleapis/java-datastore/commit/40b4011e3a826a91e33541efdecb05f0e129f87c))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-datastore).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->

* chore(main): release 2.13.1-SNAPSHOT (#934)

:robot: I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).

* chore: Enable requesting numeric enums in "transport=rest" responses for services supporting this (Java, Go, Python, PHP, TypeScript, C#, and Ruby), even if they do not yet turn on REST transport (#933)

* chore: Enable requesting numeric enums in "transport=rest" responses for services supporting this (Java, Go, Python, PHP, TypeScript, C#, and Ruby), even if they do not yet turn on REST transport

chore: disallow "transport=rest" for services where numeric enums are not confirmed to be supported (except in PHP and Java)
PiperOrigin-RevId: 493113566

Source-Link: googleapis/googleapis@758f0d1

Source-Link: googleapis/googleapis-gen@78bd8f0
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzhiZDhmMDVlMTI3NjM2M2ViMTRlYWU3MGU5MWZlNGJjMjA3MDNhYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>

* build(deps): bump certifi from 2022.9.24 to 2022.12.7 in /synthtool/gcp/templates/java_library/.kokoro (#1732) (#937)

build(deps): bump certifi

Bumps [certifi](https://togithub.com/certifi/python-certifi) from 2022.9.24 to 2022.12.7.
- [Release notes](https://togithub.com/certifi/python-certifi/releases)
- [Commits](https://togithub.com/certifi/python-certifi/compare/2022.09.24...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <[email protected]>
Source-Link: https://togithub.com/googleapis/synthtool/commit/ae0d43e5f17972981fe501ecf5a5d20055128bea
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c

* chore(deps): update dependency com.google.cloud:libraries-bom to v26.2.0 (#938)

* chore(deps): update dependency com.google.cloud:libraries-bom to v26.2.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Prateek <[email protected]>
Co-authored-by: Mend Renovate <[email protected]>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@artemptushkin artemptushkin artemptushkin approved these changes
@kolea2 kolea2 kolea2 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: datastore Issues related to the googleapis/java-datastore API. size: s Pull request size is small.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Datastore emulator fails to start without project id property

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@jainsahab @artemptushkin @kolea2
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.