Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting LocalDatastoreHelper stalls if beta gcloud component is not installed #302

Open
pomu0325 opened this issue Jan 10, 2021 · 2 comments
Labels
api: datastore Issues related to the googleapis/java-datastore API. lang: java Issues specific to Java. priority: p3 Desirable enhancement or fix. May not be included in next release. status: blocked Resolving the issue is dependent on other work. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@pomu0325
Copy link

Environment details

  • OS type and version: Debian GNU/Linux 10 (buster) (on Docker)
  • Java version: openjdk version "1.8.0_275"
  • datastore version(s): com.google.cloud:google-cloud-datastore:jar:1.105.0

Steps to reproduce

  1. Remove beta component: gcloud components remove beta
  2. Run the code which uses LocalDatastoreHelper

Code example

import com.google.cloud.datastore.testing.LocalDatastoreHelper;

public class Test {
  public static void main(String[] args) throws Exception {
    LocalDatastoreHelper emulator = LocalDatastoreHelper.create();
    emulator.start();

    System.out.println("Started!");
  }
}

How I found this

  • Removed beta component
root@17224e8a6010:/app# gcloud components remove beta --quiet
┌──────────────────────────────────────────┐
│    These components will be removed.     │
├──────────────────────┬────────────┬──────┤
│         Name         │  Version   │ Size │
├──────────────────────┼────────────┼──────┤
│ gcloud Beta Commands │ 2019.05.17 │      │
└──────────────────────┴────────────┴──────┘
...
Uninstall done!
  • Run code example, then it stalls.
root@17224e8a6010:/app# mvn exec:java -Dexec.mainClass=Test
  • Ctrl+Z and run ps to find out what command is executed via LocalDatastoreHelper
^Z
[1]+  Stopped                 mvn exec:java -Dexec.mainClass=Test
root@17224e8a6010:/app# ps -ef 
...
root      1840  1795  0 17:40 pts/1    00:00:00 python2 -S /root/google-cloud-sdk/lib/gcloud.py beta emulators datastore start --host-port=localhost:40079 --consistency=0.9
  • Execute the same command at the terminal, then it prompts whether continue to install beta component
root@17224e8a6010:/app# python2 -S /root/google-cloud-sdk/lib/gcloud.py beta emulators datastore start --host-port=localhost:40079 --consistency=0.9
You do not currently have this command group installed.  Using it 
requires the installation of components: [beta]


Your current Cloud SDK version is: 322.0.0
Installing components from version: 322.0.0

┌─────────────────────────────────────────────┐
│     These components will be installed.     │
├──────────────────────┬────────────┬─────────┤
│         Name         │  Version   │   Size  │
├──────────────────────┼────────────┼─────────┤
│ gcloud Beta Commands │ 2019.05.17 │ < 1 MiB │
└──────────────────────┴────────────┴─────────┘

For the latest full release notes, please visit:
  https://cloud.google.com/sdk/release_notes

Do you want to continue (Y/n)?  

Possible solution

Add --quiet option to run emulator, so as to silently install beta component.
pomu0325@e2cb8f2

@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/java-datastore API. label Jan 10, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jan 11, 2021
@dmahugh dmahugh added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. lang: java Issues specific to Java. and removed triage me I really want to be triaged. labels Jan 11, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jan 11, 2021
@dmahugh dmahugh added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Jan 12, 2021
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Jan 12, 2021
@BenWhitehead BenWhitehead assigned crwilcox and unassigned BenWhitehead Feb 9, 2021
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels May 10, 2021
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Jul 13, 2021
@crwilcox crwilcox added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed 🚨 This issue needs some love. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jul 22, 2021
@crwilcox crwilcox removed their assignment Jul 22, 2021
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jan 18, 2022
@meredithslota meredithslota assigned prash-mi and unassigned kolea2 Oct 10, 2022
@meredithslota
Copy link

@prash-mi Can you or @jainsahab take a look?

@meredithslota meredithslota added the status: blocked Resolving the issue is dependent on other work. label Oct 10, 2023
@jainsahab jainsahab assigned kolea2 and unassigned jainsahab Dec 7, 2023
@kolea2 kolea2 removed their assignment Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/java-datastore API. lang: java Issues specific to Java. priority: p3 Desirable enhancement or fix. May not be included in next release. status: blocked Resolving the issue is dependent on other work. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
9 participants