locked
Sandboxed Plugin fired from standar workflow (process) error RRS feed

  • Question

  • Hello,

     I have a standar workflow that executes some updates on opportunity record. One of those updates fires a sandboxed Plugin that extracts a translation for a field from an xml webresource file from CRM and inserts that value on that text field.

    The problem is that "apparently" when there is no sandbox process running on the server I get a timeout exception pointing me to that plugin. I have re-read the plugin code and I don´t seem to be able to find anything wrong...

    Once I get the exception if I click on "resume" the workflow fires the plugin without problems and advances to the next phase.

    I have two development enviroments and running on those I find no errors. This only happens on production enviroment and the only difference between enviroments is that on production enviroment the DB is on a different server...

    Help please!!!

    Thanks in advance.

    This is the error being logged on the workflow instance:

    Workflow paused due to error: Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The plug-in execution failed because the operation has timed-out at the Sandbox Client.
    System.TimeoutException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E3664847Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147204751</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>The plug-in execution failed because the operation has timed-out at the Sandbox Client.
    System.TimeoutException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E3664847</Message>
      <Timestamp>2012-05-29T14:19:56.1662703Z</Timestamp>
      <InnerFault>
        <ErrorCode>-2147204751</ErrorCode>
        <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
        <Message>The plug-in execution failed because the operation has timed-out at the Sandbox Client.
    System.TimeoutException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #8BD71F10</Message>
        <Timestamp>2012-05-29T14:19:56.1672704Z</Timestamp>
        <InnerFault>
          <ErrorCode>-2147204751</ErrorCode>
          <ErrorDetails xmlns:d4p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
          <Message>The plug-in execution failed because the operation has timed-out at the Sandbox Client.
    System.TimeoutException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E3334315</Message>
          <Timestamp>2012-05-29T14:19:56.1672704Z</Timestamp>
          <InnerFault>
            <ErrorCode>-2147220970</ErrorCode>
            <ErrorDetails xmlns:d5p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
            <Message>System.Net.Sockets.SocketException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #D32A7C8E</Message>
            <Timestamp>2012-05-29T14:19:56.1672704Z</Timestamp>
            <InnerFault i:nil="true" />
            <TraceText i:nil="true" />
          </InnerFault>
          <TraceText i:nil="true" />
        </InnerFault>
        <TraceText i:nil="true" />
      </InnerFault>
      <TraceText>
    [XXXXXXXXXXXXXXXXXXX.Plugins: XXXXXXXXXXXXXXXXXXX.Plugins.CopySalesCycleToPipelinePhase]
    [9edc18cd-4e68-e111-b45c-00155d53530e: CopySalesCycleToPipelinePhase]


    JU

    Tuesday, May 29, 2012 4:05 PM

Answers

  • Hi JU,

    You probably should check your sandbox server Event Logs for the error with the reference #D32A7C8E in it - The timeout is 2 minutes when calling a sandboxed plugin -  Your plugin could be blocked by something, the sandbox server maybe very busy, or it is doing something that requires a lot of database activity.  This is probably why you only see this on the production server!

    Check the logs to see if there is any more detail that has come from the sandbox server logging errors. If that gives you no clue why the plugin is taking so long, you could enable tracing on the sandbox server and look there for more clues.

    If your plugin is executing any SQL queries, make sure you use the NOLOCK hint, and if you are using fetchxml, use the no-lock="true" attribute.

    hth,

    Scott


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



    Tuesday, May 29, 2012 4:24 PM
    Answerer

All replies

  • Hi JU,

    You probably should check your sandbox server Event Logs for the error with the reference #D32A7C8E in it - The timeout is 2 minutes when calling a sandboxed plugin -  Your plugin could be blocked by something, the sandbox server maybe very busy, or it is doing something that requires a lot of database activity.  This is probably why you only see this on the production server!

    Check the logs to see if there is any more detail that has come from the sandbox server logging errors. If that gives you no clue why the plugin is taking so long, you could enable tracing on the sandbox server and look there for more clues.

    If your plugin is executing any SQL queries, make sure you use the NOLOCK hint, and if you are using fetchxml, use the no-lock="true" attribute.

    hth,

    Scott


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



    Tuesday, May 29, 2012 4:24 PM
    Answerer
  • Thanks a lot for the quick advice!...

    I tried looking with that reference Id on server Event Viewer but it gives me 0 matches...

    I´ll try activating traces and see whats happening...

    Thanks again for the advice. 


    JUtrilla

    Wednesday, May 30, 2012 8:20 AM
  • Well after inspecting traces we set the registry key AsyncDBAppLock=1 and apparently everything is working ok now... we have two servers for the asynch service so it makes sense... I just didn´t know of the existance of this key...

    JUtrilla

    Wednesday, May 30, 2012 2:21 PM