locked
Crm 2011 timeout exception while updating a particular entity property RRS feed

  • Question

  • Hi, 

        I am doing bulk update for contact's parentcustomerid by using the organization service proxy from windows application. I am getting the following time out exception even thought the binding & service timeout is set to 12 hours.  For other type of updates, its working like charm. I also tried to use fiddler, but for response it shows a message as "The server did not return a response for this request". How to solve the exception?

    4/22/2013 3:27 PM Exception Exception Found:
    Type: System.TimeoutException
    Message: The request channel timed out while waiting for a reply after 11:59:55.3350672. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.
    Source: mscorlib
    Stacktrace: 
    Server stack trace: 
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest request)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore(OrganizationRequest request)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Execute(OrganizationRequest request)
       at ExportToCRM.ExportToCRM.DoCRMCall(Object param)
      Inner Exception Found:
      Type: System.TimeoutException
      Message: The remote server returned an error: (504) Gateway Timeout.
      Source: System.ServiceModel
      Stacktrace:    at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
        Inner Exception Found:
        Type: System.Net.WebException
        Message: The remote server returned an error: (504) Gateway Timeout.
        Source: System
        Stacktrace:    at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactor

    Thanks,

    Ketan Mehta


    • Edited by ketanMaheta Monday, April 22, 2013 12:00 PM typo error
    Monday, April 22, 2013 11:58 AM

Answers

  • I've seen this before yes - It's the ODSP (Online Delivery Service Platform) reverse proxy that is closing your connection when it exceeds it's own timeout.

    Your request will continue running, but you'll not get the response back when it's finished.

    The only thing you can do is break your ExecuteMultiple down into smaller batches.

    hth


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Monday, April 22, 2013 3:16 PM
    Answerer

All replies

  • Hi,

    Is this with Dynamics CRM Online or OnPrem.

    I've had this before where something between the client and the server (probably some sort of reverse proxy) has a timeout where it ends the connection after 90 seconds or so - this isn't influenced by the client WCF timeout settings.

    Are you doing an ExecuteMultiple? or is this just a single updated call?


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Monday, April 22, 2013 1:23 PM
    Answerer
  • Hi Scott,

          It is Dynamics CRM Online and I am doing ExecuteMultiple.

    Monday, April 22, 2013 3:05 PM
  • I've seen this before yes - It's the ODSP (Online Delivery Service Platform) reverse proxy that is closing your connection when it exceeds it's own timeout.

    Your request will continue running, but you'll not get the response back when it's finished.

    The only thing you can do is break your ExecuteMultiple down into smaller batches.

    hth


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Monday, April 22, 2013 3:16 PM
    Answerer
  • Hi Scott,

         We tried to breakup the bulk records in chunks of 50 or 100 and in that case it fails but in later stage. I mean if we have 100 batches each containing 50 or 100 request, it will fail after processing 5 or 6 or sometimes even the first batch. that is unpredictable. 

     

    Monday, April 22, 2013 3:31 PM
  • I've had limited success with ExecuteMultiple using Dynamics CRM online as well - it's fine in OnPrem where you can control your performance characteristics.

    I would actually suggest breaking it into much smaller batches and throttling the throughput. 


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Monday, April 22, 2013 3:52 PM
    Answerer