Closed FR-ADDIX closed 3 weeks ago
That's weird ... Most mongo queries have traces, so, real quick, just turn on all traces and see what comes out. ( -t 0-255). If not enough, I'll add a call to LM_T for mongocEntitiesQuery. (sorry, no time, in a meeting)
ContextBroker Image: fiware/orion-ld:1.6.0-PRE-1578 same Error
Did you get more info with -t 0-255
?
ok I have the trigger: a simple query with the following parameters.
http://orion-ld.fiware.svc:1026/ngsi-ld/v1/entities?type=EVChargingStation&idPattern=EVChargingStation&georel=near%3BmaxDistance==100&geometry=Point&coords=[10.178318,54.351428]
Perfect. The count part is an internal thing, needed for possible future pagination and distributed ops. Doesn't come from the user. I might have to rethink that part in case of geoqueries, now that as it seems it doesn't work. With this example I can take a look at how to avoid the problem. So, big thank you!!! :)
Hi Ken,
we now have an application running that generates a lot of geo based queries and as a result we get a lot of error messages of type
“mongocEntitiesQuery.cpp[798]: Database Error (error counting entities: 17.5626500: $geoNear, $near, and $nearSphere are not allowed in this context)”
These messages are triggered by this type of request:
/ngsi-ld/v1/entities/?georel=near%3BmaxDistance%3D%3D301&geometry=Point&coords=[10.1348%2C54.314]&limit=300&q=name~%3DTIER'
Is there a solution to get around this problem? Our Orion version is orion-ld:1.6.0-PRE-1609
Hello,
I believe I've seen that error before. If it is what I think, it had a logical explanation. I'll search a little see if I can find it.
Found it. What I was referring to is from this very issue. Completely forgot about it, so sorry. MongoDB doesn't allow for the count request when $near is in use. It's an internal thing and I just have to avoid doing it. We'll see how the absence of the number of matching entities affects the algorithm. I've implemented the fix and functional tests are running. Now we can only pray :))
So, all tests passed - only because I have no functests depending on the entity count with georel=$near - I will get problems here some day in the future. I'll deal with that when we get there.
However, I can't merge the PR as we're having problems with the docker files, can't build. There's a lost package, can't download it. We're working on a complete modification of the dockerfiles. This will hopefully be ready later today. The PR will have to wait until then.
PR merged. Please test again and let me know, by closing the issue in case all is good, or, commenting on it if not.
is this in version fiware/orion-ld:1.6.0-PRE-1615?
Then it still doesn't seem to work but there is another error message: "mongocEntitiesQuery.cpp[788]: Cannot count entities if georel is 'near'. MongoDB doesn't allow it"
Yeah, that warning, not error, is new. I need to do something to tell people it's not gonna work "completely, I can't just silently "eat" the problem.
You say "it still doesn't seem to work", what exactly do you mean with that? Is something failing, or are you just referring to the new warning?
Ah ok, that's just a warning now, you're right.
I have an error message, I would like to see the query that triggers this error, is there a way to do this?
I don't actually have a $near query anywhere in which I also count the entities.
ContextBroker Image: fiware/orion-ld:1.6.0-PRE-1577