I am running into an images issue, where DD4T application is able to pull page content but not images. Following exception is thrown on image request.

[DataServiceClientException: BadRequest]
Microsoft.OData.Client.QueryResult.ExecuteQuery() +478
Microsoft.OData.Client.DataServiceRequest.Execute(DataServiceContext context, QueryComponents queryComponents) +254 [DataServiceQueryException: An error occurred while processing this request.]
Microsoft.OData.Client.DataServiceRequest.Execute(DataServiceContext context, QueryComponents queryComponents) +628
Microsoft.OData.Client.DataServiceContext.InnerSynchExecute(Uri requestUri, String httpMethod, Nullable1 singleResult, OperationParameter[] operationParameters) +519
Microsoft.OData.Client.DataServiceContext.Execute(Uri requestUri) +136 Sdl.Web.Delivery.Service.<>c__DisplayClass23_1
1.b__1() +87
Sdl.Web.Delivery.Caching.CacheHandlers.DefaultMemCache.DefaultMemCacheHandler1.SetOrGetExisting(String key, String region, Func1 valueFactory, CacheItemPolicy cacheItemPolicy) +83
Sdl.Web.Delivery.Service.<>c__DisplayClass23_0`1.b__0() +479 [ServiceQueryException: Failed to execute query]
DD4T.Factories.BinaryFactory.TryFindBinary(String url, String localPath, Boolean retrieveData, IBinary& binary) in C:\projects\dd4t-core\source\DD4T.Factories\BinaryFactory.cs:269
DD4T.Factories.BinaryFactory.FindAndStoreBinary(String url, String physicalPath) in C:\projects\dd4t-core\source\DD4T.Factories\BinaryFactory.cs:40
DD4T.Web.Binaries.BinaryFileManager.ProcessRequest(HttpRequest request) +251
DD4T.Web.Binaries.BinaryDistributionModule.DistributionModule_OnPreRequestHandlerExecute(Object o, EventArgs eventArgs) +289
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +223 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91

Following exception is logged when DD4T logging is enabled

DEBUG 2019-09-18 07:35:13,662 66590ms DefaultLogger Debug
- started GetBinaryMetaByUrl for url /ush/en/us/files/images/CNP_640x400_V2.jpg with publication id 91 DEBUG 2019-09-18 07:35:13,662 66590ms DefaultLogger Debug
- using encodedUrl: /ush/en/us/files/images/CNP_640x400_V2.jpg WARN 2019-09-18 07:35:13,670 66598ms DefaultLogger TryFindBinary
- Caught unexpected exception while retrieving binary with url /ush/en/us/files/images/CNP_640x400_V2.jpg (requested url: /ush/en/us/files/images/CNP_640x400_V2.jpg. Error message: Failed to execute query 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__DisplayClass23_01.<Execute>b__0() at Sdl.Web.Delivery.Service.Utils.PerformRetry[T](Func1 block, Int32 retryCount) at Sdl.Web.Delivery.Service.Utils.Retry[T](Func1 block, Int32 retryCount, Boolean locking) at Sdl.Web.Delivery.Dynamic.Meta.AbstractMetaFactory.DoExecuteFunc[T](ODataV4ClientFunction func, Boolean expectSingleItem) at Sdl.Web.Delivery.Caching.CacheHandlers.DefaultMemCache.DefaultMemCacheHandler1.SetOrGetExisting(String key, String region, Func`1 valueFactory, CacheItemPolicy cacheItemPolicy) at Sdl.Web.Delivery.Dynamic.Meta.AbstractMetaFactory.ExecuteFunc[T](ODataV4ClientFunction func, Boolean expectSingleItem) at Sdl.Web.Delivery.Dynamic.Meta.BinaryMetaFactory.GetMetaByURL(Int32 publicationId, String urlPath) at DD4T.Providers.Tridion9.CIL.TridionBinaryProvider.GetBinaryMetaByUrl(String url) in C:\projects\dd4t-providers-tridion9-cil\source\DD4T.Providers.Tridion9.CIL\TridionBinaryProvider.cs:line 214 at DD4T.Factories.BinaryFactory.TryFindBinary(String url, String localPath, Boolean retrieveData, IBinary& binary) in C:\projects\dd4t-core\source\DD4T.Factories\BinaryFactory.cs:line 198

We had deployed the same DD4t application in lower environments where we were able to access images and content, but it's only in staging environment we are running into an issue.

Any pointers to resolve the issue is highly appreciated!

  • 1. Any error on session-content service? 2. Is that session-content service running? 3. validate with postman request directly with CIL ODataV4? 4. Is that odatav4 endpoint working?
    – Velmurugan
    Commented Sep 18, 2019 at 19:59
  • Yes, session content service is up and running. I am able to see the binary information returned for abc:8081//client/v2/content.svc/Binaries. in the browser yet to verify in postman.
    – swapna
    Commented Sep 19, 2019 at 5:08
  • 1
    After troubleshooting we found its issue with load balancer. We pointed DD4T web app to point to the fully qualified servername content service url instead of the load balancer one. We are still working through the soultion, shall post it here once its inplace. Thanks for the suggestions and inputs posted.
    – swapna
    Commented Sep 20, 2019 at 18:47
  • I was going to say it would be good to use the latest hotfix (api role / .net) instead of relying on the Sdl.Web.Delivery 11.0 Nuget package. For one of my own projects I created a Nuget package of my own with the latest hotfix and pushed that to a private Nuget repository. But I just noticed that SDL have released a new version for 11.0 (which probably serves as a hotfix rollup), namely 11.0.1055. You could try upgrading to that, regardless of the outcome of your load balancer change.
    – Quirijn
    Commented Sep 21, 2019 at 9:58
  • Thanks Quirjin, shall reach out SDL and get the hotfix.
    – swapna
    Commented Sep 23, 2019 at 18:33

1 Answer 1


Issue is resolved by adding the redirection headers which got stripped off for binaries on the load balance for the content service. Thanks!

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.