locationtech / geowave

GeoWave provides geospatial and temporal indexing on top of Accumulo, HBase, BigTable, Cassandra, Kudu, Redis, RocksDB, and DynamoDB.
Apache License 2.0
501 stars 190 forks source link

Error creating spatial_temporal index on DynamoDB store #1712

Closed michaeljfazio closed 4 years ago

michaeljfazio commented 4 years ago

Steps to reproduce:

1) Add a DynamoDB store:

geowave store add --type dynamodb --region ap-southeast-2 geospatial

2) Add a new spatial_temporal index:

geowave index add --type spatial_temporal --period MONTH geospatial st_idx

Expected

Successful creation of new spatial temporal index.

Observed

27 Apr 18:02:28 WARN [cli.GeoWaveMain] - Unable to execute operation
java.lang.IllegalArgumentException: Cannot create enum from AP_SOUTHEAST_2 value!
    at com.amazonaws.regions.Regions.fromName(Regions.java:79)
    at org.locationtech.geowave.datastore.dynamodb.config.DynamoDBOptions$RegionConverter.convert(DynamoDBOptions.java:194)
    at org.locationtech.geowave.datastore.dynamodb.config.DynamoDBOptions$RegionConverter.convert(DynamoDBOptions.java:190)
    at com.beust.jcommander.JCommander.convertValue(JCommander.java:1305)
    at org.locationtech.geowave.core.cli.prefix.JCommanderPropertiesTransformer.transformFromProperties(JCommanderPropertiesTransformer.java:178)
    at org.locationtech.geowave.core.cli.api.DefaultPluginOptions.load(DefaultPluginOptions.java:67)
    at org.locationtech.geowave.core.store.cli.store.StoreLoader.loadFromConfig(StoreLoader.java:79)
    at org.locationtech.geowave.core.store.cli.store.StoreLoader.loadFromConfig(StoreLoader.java:58)
    at org.locationtech.geowave.core.store.cli.index.AddIndexCommand.computeResults(AddIndexCommand.java:85)
    at org.locationtech.geowave.core.store.cli.index.AddIndexCommand.execute(AddIndexCommand.java:71)
    at org.locationtech.geowave.core.cli.GeoWaveMain.run(GeoWaveMain.java:70)
    at org.locationtech.geowave.core.cli.GeoWaveMain.main(GeoWaveMain.java:41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
    at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:62)
rfecher commented 4 years ago

thanks for catching that, the bug fix is in as PR #1713. The enums toString() serialization differs from its fromValue() deserialization (so for example if you run geowave config list -f region you'll notice the toString() serialization). I believe a temporary workaround until this fix is released would be to run geowave config set store.geospatial.opts.region ap-southeast-2 after creating the datastore to explicitly set the region using lower-case and hyphen per the expected fromValue().

michaeljfazio commented 4 years ago

Thanks @rfecher

I've confirmed that the workaround is working.

jdgarrett commented 4 years ago

The fix has been merged.