1

Exceptions/SyncDownloadException

From Resco's Wiki
Jump to navigation Jump to search

SyncDownloadException: Exception while fetching entity x is a type of exception that can appear in the sync log of Resco mobile apps.

About this exception

SyncDownloader is important process during synchronization. It it responsible for the download of entity records. Problems with fetching data from the server mean that the affected entity won't be downloaded in this synchronization run.

Handling

  • When analyzing SyncDownloadException problems, make sure you know how the SyncDownloader works.
  • Often, this exception can occur in the network connection or on the server. Connection problems are usually temporary - try again later. Server problems often require more analysis.
  • The log usually includes additional details about the problem.

Example: network connection lost

<Exception>07:35:01.952: SyncDownloadException: Exception while fetching entity lead
Net.WebRequestException: The network connection was lost. (-1005) | NetInfo: [TransientConnection, Reachable, IsWWAN] | Duration: 45228ms
  at Net.HttpConnection.GetResponse (Net.HttpWebRequestSync request)
  at WebServiceBase.GetServerResponse (Net.HttpWebRequestSync request)
  at WebServiceBase.XmlResponse..ctor()
  at Crm2011.CrmService2011+<ExecuteFetch>d__59.MoveNext ()
  at SyncEngine+EntityDownloader.Downloader ()
</Exception>

Error analysis: Lost connection. The problem happened while downloading lead records. The next sync will finalize the interrupted download.

Example: index out of range

<EXCEPTION>08:35:13.202: SyncDownloadException: Exception while fetching entity annotation
Net.RescoSoapException: Server Error: ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: chunkLength
<soap>Code.Value=s:Sender| Detail.OrganizationServiceFault.ActivityId=dc94062e-0a15-4113-b993-26aa856eb221| Detail.OrganizationServiceFault.ErrorCode=-2147220970| Detail.OrganizationServiceFault.HelpLink=http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040216&client=platform| Detail.OrganizationServiceFault.Timestamp=2020-07-28T06:35:12.3290687Z| Detail.OrganizationServiceFault.ExceptionRetriable=false| Detail.OrganizationServiceFault.ExceptionSource=PluginExecution| Detail.OrganizationServiceFault.OriginalException=ArgumentOutOfRangeException
at Text.StringBuilder.ToString()
at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IOrganizationServiceFactory organizationServiceFactory, Dictionary`2 sandboxServices, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, IPluginExecutionContext requestContext, Boolean...
</soap>
at WebServiceBase.XmlResponse..ctor()
at Crm2011.CrmService2011.<ExecuteFetch>d__60.MoveNext()
at SyncEngine.EntityDownloader.Downloader()
</EXCEPTION>

The interpretation of this error is pretty difficult.

  • At the first glance will notice that sync download was interrupted due to a server error "while fetching entity annotation".
  • If you look further, you will notice the server error ArgumentOutOfRangeException. And that's strange because it reminds a programming error.
  • Those who know something about Dynamics internals will notice this interesting snippet among <soap> details: "ExceptionSource=PluginExecution". Well, this looks like a bug in some plugin.
    Could be that the customer uses low-quality plugin extensions? If you don't know what is plugin, here is how Microsoft describes it: "A plug-in is a custom business logic that integrates with Dynamics CRM to modify or extend the standard platform behavior. Plug-ins act as event handlers and are registered to execute on a particular event in CRM."
  • Finally, if you have a programmer background, you could extract even more info about the server error:
StringBuilder.ToString() generated ArgumentOutOfRangeException.
This error cannot be explained by normal usage of the StringBuilder class. The only way to explain it is by uncoordinated access of a StringBuilder instance from several threads.
Hence, this is an apparent error of the programmers who wrote the server plugin. They did not pay attention to the possibility that the plugin can be called simultaneously from several places.

Example: object reference not set to an instance of an object

<EXCEPTION>15:17:31.881: SyncDownloadException: Exception while fetching entity resco_favorite
Net.RescoSoapException: Server-Fehler: Object reference not set to an instance of an object.
<soap>Code=500| Reason=NullReferenceException| SupportId=578c863c-360c-41ed-9787-bcf9047dde45</soap>
  at WebServiceBase.ThrowSoapException(Net.HttpException ex)
  at WebServiceBase.XmlResponse..ctor(Object context, Boolean soap, Data.WebService.WebServiceBase webService, Xml.XmlReaderSettings xmlSettings, Boolean processMultipartResponses)
  at Xrm.XrmService.BeginInvoke(String action, Object context, Action<Xml.XmlWriter,Object> writeXml, Xml.XmlReader& reader)
  at Xrm.XrmService.<ExecuteFetch>d__30.MoveNext()
  at Salesforce.SalesforceService.<ExecuteFetch>d__64.MoveNext()
  at Salesforce.SalesforceService.<ExecuteFetch>d__65.MoveNext()
  at SyncEngine.EntityDownloader.Downloader()
</EXCEPTION>

Error analysis:

  • Fatal sync error during the download of the resco_favorite entity.
  • NullReferenceException clearly points to a programming bug (usage of uninitialized pointer).
  • Looks like a server bug, Resco has no possibility to avoid the problem.





Was this information helpful? How can we improve?