Repository navigation
cloud-datastore-emulator Version 1.3 leads to "Invalid version format" #2559
Copy link
Copy link
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important 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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important 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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
Mindful commentedon Oct 31, 2017
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)thedrover commentedon Nov 6, 2017
I resolved this problem by upgrading the GCloud SDK from version 177 to version 178. The following is from the release summary:
neozwu commentedon Nov 7, 2017
@thedrover thank you for letting us know. I'll close this issue since you have resolved the problem. Feel free to reopen it.
fix(deps): add detector-resource-support dependencies (#2559)
chore(main): release 2.38.1 (#2581)
deps: update googleapis/sdk-platform-java action to v2.62.2 (#2559)
deps: update googleapis/sdk-platform-java action to v2.62.2 (#2559)