Question

Photo of SecureGive Giving Solutions

0

The node count limit of '100' has been exceeded error received

Hello,

We're receiving 400 Bad Request responses when sending API requests to a customer RockRMS instance API. Note: We do not have configuration access to their instance, we maintain a third party integration that is authenticated to the api for their instance. The error is received when we attempt GET requests to the /api/Groups endpoint. The full response message is:

"The query specified in the URI is not valid. The node count limit of '100' has been exceeded. To increase the limit, set the 'MaxNodeCount' property on EnableQueryAttribute or ODataValidationSettings."

Can you comment on the reason(s) we're receiving this response? And potential resolutions?


An example request would be:

https://organization/api/Groups/?$filter=GroupTypeId+eq+10+and+Members/any(m:+m/PersonId+eq+48+or+m/PersonId+eq+261+or+m/PersonId+eq+603+or+m/PersonId+eq+651+or+m/PersonId+eq+1469+or+m/PersonId+eq+1866+or+m/PersonId+eq+2270+or+m/PersonId+eq+2271+or+m/PersonId+eq+2906+or+m/PersonId+eq+3476+or+m/PersonId+eq+3477+or+m/PersonId+eq+3498+or+m/PersonId+eq+4359+or+m/PersonId+eq+4745+or+m/PersonId+eq+5150+or+m/PersonId+eq+5869+or+m/PersonId+eq+5933+or+m/PersonId+eq+6791+or+m/PersonId+eq+6851+or+m/PersonId+eq+6882+or+m/PersonId+eq+6883+or+m/PersonId+eq+6950+or+m/PersonId+eq+6979+or+m/PersonId+eq+7009+or+m/PersonId+eq+7783+or+m/PersonId+eq+7784+or+m/PersonId+eq+7786+or+m/PersonId+eq+7787+or+m/PersonId+eq+7789)&$expand=GroupLocations/Location,Members&$top=51


Thank you!

  • Photo of Daniel Hazelbaker

    0

    It looks like by default, OData limits the query to 100 "nodes" (I read that as "individual simple filters"). Meaning, "PersonId eq 1469" would be one node. It looks like the only solution is to change the Rock core code that initializes the OData system to up that limit: https://github.com/OData/RESTier/issues/545

    However, you are likely to eventually run into a second limit that is imposed by IIS. IIS will throw an error if your query string exceeds 2048 bytes.

    If you are unable to re-write the OData query in a way that would reduce the number of nodes, perhaps you could add a custom API endpoint that accepts the PersonIds as POST data and then run the query internally and return the results, thus bypassing OData. Example query (almost certainly not 100% correct):

    groupService.Queryable().Where( g => g.GroupTypeId == 10 && g.Members.Any( m => personIdList.Contains( m.PersonId ) ) );