We have broker queries running OK on Sites 9.5 and DXA 2.9, after upgrade to Sites 10 and DXA 2.3 the queries return empty result with the following error logged in cd_client.log

[Tridion.ContentDelivery.DynamicContent.Query.Query.ExecuteEntityQuery] - Problem executing entity query.
        Sdl.Web.Delivery.Service.ServiceQueryException: Failed to execute query ---> Microsoft.OData.Client.DataServiceQueryException: An error occurred while processing this request. ---> Microsoft.OData.Client.DataServiceClientException: <html>
        <head><title>504 Gateway Time-out</title></head>
        <center><h1>504 Gateway Time-out</h1></center>
           at Microsoft.OData.Client.QueryResult.ExecuteQuery()
           at Microsoft.OData.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
           --- End of inner exception stack trace ---
           at Microsoft.OData.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
           at Microsoft.OData.Client.DataServiceContext.InnerSynchExecute[TElement](Uri requestUri, String httpMethod, Nullable`1 singleResult, OperationParameter[] operationParameters)
           at Microsoft.OData.Client.DataServiceContext.Execute[TElement](Uri requestUri, String httpMethod, OperationParameter[] operationParameters)
           at Sdl.Web.Delivery.Service.ODataV4Service.<>c__DisplayClass19_1`1.<Execute>b__1()
           at Sdl.Web.Delivery.Caching.CacheHandlers.DefaultMemCache.DefaultMemCacheHandler`1.SetOrGetExisting(String key, String region, Func`1 valueFactory, CacheItemPolicy cacheItemPolicy)
           at Sdl.Web.Delivery.Service.ODataV4Service.<>c__DisplayClass19_0`1.<Execute>b__0()
           --- End of inner exception stack trace ---
           at Sdl.Web.Delivery.Service.AbstractODataService.HandleHttpResponseCode(Exception e, Int32 statusCode)
           at Sdl.Web.Delivery.Service.AbstractODataService.HandleException(Exception e)
           at Sdl.Web.Delivery.Service.ODataV4Service.<>c__DisplayClass19_0`1.<Execute>b__0()
           at Sdl.Web.Delivery.Service.Utils.PerformRetry[T](Func`1 block, Int32 retryCount)
           at Sdl.Web.Delivery.Service.Utils.Retry[T](Func`1 block, Int32 retryCount, Boolean locking)
           at Sdl.Web.Delivery.Broker.Querying.QueryImpl.DoExecuteEntityQuery(ODataV4ClientAction action)
           at Sdl.Web.Delivery.Caching.CacheHandlers.DefaultMemCache.DefaultMemCacheHandler`1.SetOrGetExisting(String key, String region, Func`1 valueFactory, CacheItemPolicy cacheItemPolicy)
           at Sdl.Web.Delivery.Broker.Querying.QueryImpl.ExecuteEntityQuery()

Example query

List<Criteria> children = new List<Criteria>();

children.Add(new ItemTypeCriteria(itemType));
children.Add(new PublicationCriteria(publicationId));
children.Add(new PageURLCriteria($"{structureGroupPath}%", Criteria.Like));

Criteria prCriteria = new AndCriteria(children.ToArray());

Tridion.ContentDelivery.DynamicContent.Query.Query query = new Tridion.ContentDelivery.DynamicContent.Query.Query(prCriteria);

SortParameter sortParameter = new SortParameter(SortParameter.ItemTitle, SortParameter.Ascending);

IItem[] results = query.ExecuteEntityQuery();

1 Answer 1


The issue you are encountering with the ExecuteEntityQuery method returning empty results and logging a 504 Gateway Time-out error suggests a problem related to connectivity or configuration in your upgraded environment (Sites 10 and DXA 2.3).

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

Check Connectivity and Configuration:

  • Verify that all necessary services (e.g., Content Delivery Services) are up and running.
  • Ensure that the discovery endpoints in your configuration file is correctly pointing to the new service in Sites 10 and DXA 2.3.

Validate Service Availability:

  • Directly access the discovery/content services URLs in a web browser or use tools like Postman to confirm that the service is reachable and responsive.
  • Check for any network issues or firewall settings that might be blocking access to the service.

Review Dependency Libraries:

  • Ensure all required DLLs and libraries are present and correctly referenced in your project.
  • Pay particular attention to the versions of the DLLs, as mismatched versions can cause compatibility issues.

Increase Timeout Settings:

  • A 504 Gateway Time-out error often indicates that the server took too long to respond. Check if there are timeout settings in your application configuration or on the server that need to be increased.

Examine Logs:

  • Look for additional details in the logs (both client and server-side) that might provide more context about the failure.
  • Enable more detailed logging if necessary to capture additional information. Upgrade Considerations:

Sample Query Execution:

As a test, simplify the query to the minimum criteria and see if it executes successfully. This can help isolate whether the issue is with specific criteria or the overall query execution.

If the simplified query works, you can gradually add back the other criteria to identify which one might be causing the problem.

By methodically going through these steps, you should be able to identify and resolve the issue causing the 504 Gateway Time-out error when executing the query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.