Issue
When retrieving data via OData with a complex filter query, the request fails with an 400 Bad Request error. The error message states:
"The node count limit of '100' has been exceeded. To increase the limit, set the 'MaxNodeCount' property on EnableQueryAttribute or ODataValidationSettings"Environment
- Applications hosted in any deployment type
- Studio Pro (all versions)
Cause
This error occurs when making GET requests to OData endpoints with filters that exceed the default node count threshold.
In this example, the OData service has a default limit of 100 nodes for query complexity. When the OData query contains a filter expression that exceeds this node count (for example, a filter with many OR conditions or complex nested expressions), the service rejects the request to prevent potential performance issues or denial of service attacks.
The MaxNodeCount property is a server-side configuration that limits the complexity of incoming OData queries. This limit cannot be configured from the client side (Mendix application making the request).
Solution/Workaround
To mitigate this issue, there are two options:
Option 1: Simplify the OData query
- Reduce the complexity of the filter expression by breaking it into multiple smaller queries
- Retrieve data in batches using pagination
- Refactor the filter logic to use fewer OR conditions or nested expressions
- Use different query approaches that result in simpler filter expressions
Option 2: Increase the MaxNodeCount on the OData service provider
- Contact the administrator of the OData service (the server providing the OData endpoint)
- Request an increase to the
MaxNodeCountproperty in the OData service configuration - Note that this configuration must be changed on the server side and cannot be modified from the Mendix client application
Note: The MaxNodeCount setting is a security measure on the OData service provider side. Mendix applications consuming the OData service cannot override this setting through request parameters or client-side configuration.
Internal information related
- 274296, 187466
- C0A044PPS/p1687185110918949
Additional information
- Mendix documentation:
0 Comments