Skip to content

cloud-datastore-emulator Version 1.3 leads to "Invalid version format" #2559

Closed

Description

@kyzrfranz

After updating to Google Cloud SDK 177.0.0, we found the LocalDatastoreHelper crashing in the following way:

java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:47) {...} Caused by: java.lang.IllegalArgumentException: Invalid version format at com.google.cloud.testing.Version.fromString(Version.java:90) ~[google-cloud-core-1.0.2.jar:1.0.2] at com.google.cloud.testing.BaseEmulatorHelper$GcloudEmulatorRunner.getInstalledEmulatorVersion(BaseEmulatorHelper.java:327) ~[google-cloud-core-1.0.2.jar:1.0.2] at com.google.cloud.testing.BaseEmulatorHelper$GcloudEmulatorRunner.isEmulatorUpToDate(BaseEmulatorHelper.java:306) ~[google-cloud-core-1.0.2.jar:1.0.2] at com.google.cloud.testing.BaseEmulatorHelper$GcloudEmulatorRunner.isAvailable(BaseEmulatorHelper.java:272) ~[google-cloud-core-1.0.2.jar:1.0.2] at com.google.cloud.testing.BaseEmulatorHelper.startProcess(BaseEmulatorHelper.java:100) ~[google-cloud-core-1.0.2.jar:1.0.2] at com.google.cloud.datastore.testing.LocalDatastoreHelper.start(LocalDatastoreHelper.java:192) ~[google-cloud-datastore-1.0.2.jar:1.0.2] at com.rewedigital.fulfillment.core.service.config.TestDatastoreConfig$TestHelperDatastore.afterPropertiesSet(TestDatastoreConfig.java:52) ~

It seems that com.google.cloud.testing.Version expects a version number following this RegExp:
private static final Pattern VERSION_PATTERN = Pattern.compile("^(\\d+)\\.(\\d+)\\.(\\d+)$");
Since the current Version "1.3" does not conform to it - it leads to the exceptions above.

Activity

  1. Mindful commented on Oct 31, 2017

    @Mindful

    Seeing the same problem. I have a test suite that runs fine on my local machine, but crashes when it runs on our CD pipeline, which has version 1.3.

    java.lang.IllegalArgumentException: Invalid version format at com.google.cloud.testing.Version.fromString(Version.java:90) at com.google.cloud.testing.BaseEmulatorHelper$GcloudEmulatorRunner.getInstalledEmulatorVersion(BaseEmulatorHelper.java:327) at com.google.cloud.testing.BaseEmulatorHelper$GcloudEmulatorRunner.isEmulatorUpToDate(BaseEmulatorHelper.java:306) at com.google.cloud.testing.BaseEmulatorHelper$GcloudEmulatorRunner.isAvailable(BaseEmulatorHelper.java:272) at com.google.cloud.testing.BaseEmulatorHelper.startProcess(BaseEmulatorHelper.java:100) at com.google.cloud.datastore.testing.LocalDatastoreHelper.start(LocalDatastoreHelper.java:192)

  2. added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    api: datastoreIssues related to the Datastore API.
    on Nov 1, 2017
  3. thedrover commented on Nov 6, 2017

    @thedrover

    I resolved this problem by upgrading the GCloud SDK from version 177 to version 178. The following is from the release summary:

    Google Cloud Datastore Emulator
    ▪ Cloud Datastore Emulator version changed from 1.3 to 1.3.0 for gcloud
    emulator package compatibility, with no other changes.

  4. neozwu commented on Nov 7, 2017

    @neozwu
    Contributor

    @thedrover thank you for letting us know. I'll close this issue since you have resolved the problem. Feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to 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