-
Notifications
You must be signed in to change notification settings - Fork 77
Description
I followed the steps to set up a docker instance at https://fraunhoferiosb.github.io/FROST-Server/deployment/docker.html, which gives a running FROST server. Then I tried inserting the demoEntities.json file. At first it failed because the default compose file has plugins_multiDatastream.enable=false
, which I fixed by flipping that to true. Then:
❯ curl -X POST -H "Content-Type: application/json" -d @demoEntities.json http://localhost:8081/FROST-Server/v1.1/Things
{"code":400,"type":"error","message":"Size of result array (2) must match number of observed properties (0) in the MultiDatastream."}
I took a quick glance at the relevant code:
Lines 375 to 381 in 785067a
Integer count = pm.getDslContext() | |
.selectCount() | |
.from(tableMdsOps) | |
.where(((TableField) tableMdsOps.getMultiDatastreamId()).eq(mdsId)) | |
.fetchOne().component1(); | |
if (count != list.size()) { | |
throw new IllegalArgumentException("Size of result array (" + list.size() + ") must match number of observed properties (" + count + ") in the MultiDatastream."); |
I suspect that there might be an ordering issue here with deep inserts, where the observedProperties are not added (or not committed) to the database yet when the observations are added, but I am not at all familiar with the code, so did not dig further than this.
If I leave out the observations from the MultiDataStream, the data inserts as expected.