Start a new topic

Serious bug in querying functionality ("DisallowedQuerySyntax")

Hi All,

It seems that there is a serious bug in the querying functionality:

At first, I noticed it using Kinvey iOS library, but now I've also reproduced it using Kinvey API Console, so it's not platform-dependent.

When I perform the following sample query:

GET /appdata/kid_XXXXXXX/MyEntity/?query=%7B%22myField%22%3A%7B%22%24regex%22%3A%22searchString%22%2C%22%24options%22%3A%22i%22%7D%7D&sort=%7B%22questionDate%22%3A-1%7D&limit=10

... sometimes I get the proper response, containing the objects of "MyEntity", but sometimes, for the same request sent from Kinvey API Console, I get the following error response:


"error": "DisallowedQuerySyntax",

"description": "Your query included syntax that is not supported. Please refer to the debug property or contact support for more information.",

"debug": "Regular expression in queries must be anchored at the beginning (they must start with ^)"


It is inevitably error on Kinvey side, as for the same request I get different results, randomly (either a proper response, or error response).

Unfortunately, I can see that "" is no longer active, there I am forced to report this bug here.

Can anybody help?



I can confirm. It is happening for HTML5 backend too.

Query: query:{"$or":[{"deleted":{"$exists":false}},{"deleted":false}],"owner":"abcdef","status":"active"}

By refreshing the page I'm either seeing normal response or 500 with following response: {"error":"KinveyInternalErrorRetry","description":"The Kinvey server encountered an unexpected error. Please retry your request","debug":"Your query included syntax that is not supported"}

It is happening randomly and quite often - for ~50 refreshes, I saw this error around 20 times.

Please assist.
Hey Karol and Serge,

Thanks for this! I'll shoot you an update when we have one.
+1 for this. Happening 100% of the time using the REST api. Also queries that used to work are saying that regex must be anchored with '^'.
+1 for regex problems, dont know what causing this anyone from kinvey staff can clear our questions here?
Hi All,

Here's the answer as to why this is happening: we made some changes to RegEx on Nov 20th- they need to start with an anchor and can't be case-insensitive. See (Nov 20th update).
Hi Caroline,

It seems like this is quite a severe restriction on revved search functionality. I have several apps that were using regex to provide in-app search functions that are very restricted after this change. For example I want to find all users whose email address is * but now this is not possible. Are there any plans to reverse this change?
Supporting regex on our system is too resource intensive, though we do plan on adding proper fulltext support in the future. If you have specific use case examples that you need help solving, let us know and we can help.
Hi Caroline,

I understand that regex processing is expensive. I hope at some point Kinvey are able to consider reversing this decision, as it was a lovely feature.

In the meanwhile I will work around the issue with:

* a pre-save collection hook that duplicates searchable text fields into an uppercase form

* regexes prepended with ^[\s\S]* (so for example what would have been /[0-9]+/i would now become /^[\s\S]*[0-9]+/ against the uppercase duplicate field

Login or Signup to post a comment