We use proprietary and third party´s cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
Ask Your Question
0

Strange Comet issues

asked 2018-06-09 13:22:59 +0200

Pedro D. gravatar image

updated 2018-06-09 13:25:21 +0200

Dear Fiware,

I am trying to connect STH Comet to Orion in order to aggregate some events.

However I am having some errors:

In order to reproduce this errors for you to analyze, I have created this small project that isolates Orion and STH Comet, and reproduces the error in the log messages: https://github.com/PedroD/comet_demo

When you run it, you will find log messages.

These log messages contain all commands that the coordinator app sends to Orion and STH Comet, so that you don't need to worry about the Kotlin project's source.

In sum, the issues we are having are:

1) Comet is, for some reason, overflowing like this:

sth_1 | time=2018-06-09T11:04:02.626Z | lvl=WARN | corr=n/a | trans=n/a | op=OPER_STH_DB_LOG | from=n/a | srv=n/a | subsrv=n/a | comp=STH | msg=The size in bytes of the namespace for storing the aggregated data ("sth_sensei_service" plus "sth_/sensei,/sensei,/sensei,/sensei,/sensei,/sensei,/sensei,/sensei,/sensei,/sensei_PersonDetection_PersonDetection.aggr", 138 bytes) is bigger than 120 bytes

2) Comet is for some reason, having issues persisting some data in mongo, despite that the coordinator only tries to register the entities once:

sth_1 | time=2018-06-09T11:04:12.870Z | lvl=ERROR | corr=d78056a4-6bd4-11e8-97dd-0242ac120005 | trans=745ad73e-ebd0-49a4-b843-261981c8f9b2 | op=OPER_STH_POST | from=n/a | srv=sensei_service | subsrv=/sensei | comp=STH | msg=Error when getting the raw data collection for storing:MongoError: a collection 'sth_sensei_service.sth_/sensei_PersonDetection_PersonDetection' already exists

3) When asked for aggregations, using the url below, Comet returns empty values:

URL: http://sth:8666/STH/v1/contextEntities/type/PersonDetection/id/PersonDetection/attributes/positionX?aggrMethod=sum&aggrPeriod=second&dateFrom=2016-02-01T00:00:00.000Z&dateTo=2019-01-01T23:59:59.999Z

demo_1 | Requesting aggregation to Comet: demo_1 | {"contextResponses":[{"contextElement":{"attributes":[{"name":"positionX","values":[]}],"id":"PersonDetection","isPattern":false,"type":"PersonDetection"},"statusCode":{"code":"200","reasonPhrase":"OK"}}]} demo_1 | demo_1 | Comet seems to be sending an empty "values" array. What is going on? demo_1 |

What is going on? How can we solve these issues?

Thanks!

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
0

answered 2018-06-11 09:40:56 +0200

Martel gravatar image

Hi, I've reproduced your error here. It's a weird problem and error message indeed. I see your code is using a NGSI v2 subscription, which unfortunately I believe STH does not support yet (https://github.com/telefonicaid/fiwar...)

I suggest you try with a NGSI v1 subscription to Orion (you can keep the rest of the posts as v2). You have an example of a V1 subscription in this postman collection we use in the SmartSDK project: https://github.com/smartsdk/smartsdk-...

Hope that helps. Cheers,

edit flag offensive delete link more

Comments

Thanks, I'll try that.

Pedro D. gravatar imagePedro D. ( 2018-06-11 18:36:36 +0200 )edit

Hello Martel, I tried your suggestion but I am getting the exact same behaviour. Here you can take a look at the JSON of my Comet's subscription request using V1: https://github.com/PedroD/comet_demo/blob/master/demo_coordinator/src/main/kotlin/Main.kt#L86

Pedro D. gravatar imagePedro D. ( 2018-06-15 20:39:58 +0200 )edit
0

answered 2018-06-11 10:26:52 +0200

jmcantera gravatar image

updated 2018-06-11 10:29:29 +0200

A v2 subscription can also be used you just need to set attrsFormat to legacy. Example:

{ "description": "Notify me of all product price changes", "subject": { "entities": [{"idPattern": ".*", "type": "Product"}], "condition": { "attrs": [ "price" ] } }, "notification": { "http": { "url": "http://context-provider:3000/subscription/price-change" }, "attrsFormat" : "legacy" } }

edit flag offensive delete link more

Comments

Yes, I tried that as well. But it is very strange because even then it gives the same errors. As you can see here I am already doing that in the example (https://github.com/PedroD/comet_demo/blob/master/demo_coordinator/src/main/kotlin/Main.kt#L103). May I be missing something fundamental to Comet?

Pedro D. gravatar imagePedro D. ( 2018-06-11 18:35:50 +0200 )edit
0

answered 2018-06-27 15:00:19 +0200

Jason Fox gravatar image

In your demo I’ve checked - you are connecting to a mongo DB - you are aggregating

docker run -it --network comet_demo_fiware_network --entrypoint /bin/bash mongo

mongo --host mongo_sth --port 27018

show dbs

admin 0.000GB config 0.000GB local 0.000GB sth_sensei_service 0.000GB

use sth_sensei_service

It looks the that your subscription is incorrect: { "entities": [ { "type": "PersonDetection", "isPattern": "false", "id": "PersonDetection" } ], "attributes": [ "ts" ], "reference": "http://sth:8666/notify" }

This means you are storing the ts attribute only.

Your request to comet is reading positionX and which has not been aggregated.

http://sth:8666/STH/v1/contextEntities/type/PersonDetection/id/PersonDetection/attributes/positionX

I hope this helps - you will need to alter your subscription - the attributes should be:

"attributes": [ “ts”, “posistionX” “positionY" ]

edit flag offensive delete link more

Comments

Hello Jason, thank you for your suggestion. I have corrected that issue as you can see here (https://github.com/PedroD/comet_demo/blob/master/demo_coordinator/src/main/kotlin/Main.kt#L86). However, when requested, Comet still returns an empty array in its HTTP responses.

Pedro D. gravatar imagePedro D. ( 2018-07-09 19:08:31 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-09 13:22:59 +0200

Seen: 3,184 times

Last updated: Jun 27 '18