Open tudamp opened 1 month ago
ok, that definitely sounds like a stupid bug I need to fix. Could you please provide the exact payload bodies for the two subscriptions. Having that it should be straightforward to reproduce the issue and then also straightforward to fix it. Thank you for reporting!
Thank you for your attention!
I realised that it is sufficient to have a registered subscription and then query V2 API
curl -X POST -H 'fiware-service: test' -H 'fiware-servicepath: /#' -H 'content-type: application/ld+json' -d '{
"description": "Notify me of all product price changes",
"type": "Subscription",
"entities": [{"type": "Product"}],
"watchedAttributes": ["price"],
"notification": {
"format": "keyValues",
"endpoint": {
"uri": "http://tutorial:3000/subscription/price-change",
"accept": "application/json"
}
},
"@context": "https://smartdatamodels.org/context.jsonld"
}' http://localhost:1026/ngsi-ld/v1/subscriptions`
and then:
curl -H 'fiware-service: test' http://localhost:1026/v2/subscriptions
curl: (52) Empty reply from server
I hope this helps
That should really help. Thanks!
So, I implemented a functional test for this. Only, it doesn't fail. All good ...
I used mongo v3.6 and what I have in the develop branch right now. No error. I also tried the version 1.6.0 of Orion-LD. Also no problem. So, not able to reproduce. Need more input. Please supply the dockerfile you use for Orion-LD and I'll start my Orion-LD with the exact same parameters. In my test I used only:
-multiservice [-experimental]
(I tried both with and without the -experimental
CLI)
Forget the comment about not being able to reproduce. I did the GET /subscriptions using LD and not V2. Once I realized my mistake, I reproduced the crash immediately, and in a few minutes I fixed it. PR on its way, should be ready in an hour or so.
Environment
orion-ld:1.6.0 mongo:3.6
Description
We are using orion-ld in an environment where there are components using the V2 part and others using the LD part.
Recently we realised that when we have both ‘V2-type’ and ‘LD-type’ subscriptions in the same NGSI-Tenant, the call to /v2/subscriptions throws an exception that crashes orion-ld. The error output is:
terminate called after throwing an instance of ‘mongo::MsgAssertionException’ what(): wrong type for field (_id) 2 != 7
In the same NGSI-Tenant, the call to the LD endpoint is executed correctly. If no LD subscriptions are present the V2 endpoint responds correctly.