locked
EOF Error - XrmServiceContext - Crm 2013 Online RRS feed

  • Question

  • We have a process we run on a regular basis to extract certain records from the Crm and place them into an intermediate "Cache" which is a sql table. The process will run for a few cycles, then we will get this error.

    Received an unexpected EOF or 0 bytes from the transport stream.

    It will continue to get this error for every cycle after the first error. I went ahead and setup a web based "backup" call for my client, which allows them to kick the process files off manually, which works most of the time but occasionally will give the same error above. I know this error usually has to do with some SSL/TLS issues, but I can't seem to figure out how to modify the XrmServiceContext connection.

    I'm stumped, because it is so intermittent.

    Here is the full stack trace:

    Server Error in '/' Application.

    Received an unexpected EOF or 0 bytes from the transport stream.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 


    [IOException: Received an unexpected EOF or 0 bytes from the transport stream.]
       System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) +8663229
       System.ServiceModel.Channels.WebResponseInputStream.Read(Byte[] buffer, Int32 offset, Int32 count) +199

    [CommunicationException: An error (Received an unexpected EOF or 0 bytes from the transport stream.) occurred while transmitting data over the HTTP channel.]
       System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14799942
       System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +622
       Microsoft.IdentityModel.Protocols.WSTrust.IWSTrustContract.Issue(Message message) +0
       Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr) +69
       Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Issue(AuthenticationCredentials authenticationCredentials) +831
       Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateInternal(AuthenticationCredentials authenticationCredentials) +325
       Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateWithOrgIdForACS(AuthenticationCredentials authenticationCredentials, Uri identifier) +128
       Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateOnlineFederationInternal(AuthenticationCredentials authenticationCredentials) +599
       Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(AuthenticationCredentials authenticationCredentials) +235
       Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(ClientCredentials clientCredentials) +150
       Microsoft.Xrm.Client.Services.OrganizationService.CreateUserTokenResponse(CrmConnection connection, IServiceConfiguration`1 config) +613
       Microsoft.Xrm.Client.Services.OrganizationService.GetUserTokenResponse(CrmConnection connection, IServiceConfiguration`1 config) +288
       Microsoft.Xrm.Client.Services.OrganizationService.ToOrganizationServiceProxy(CrmConnection connection) +266
       Microsoft.Xrm.Client.Services.OrganizationService.ToOrganizationService(CrmConnection connection) +15
       System.Lazy`1.CreateValue() +14276560
       System.Lazy`1.LazyInitValue() +476
       Microsoft.Xrm.Client.Services.InnerOrganizationService.UsingService(Func`2 action) +107
       Microsoft.Xrm.Client.Services.CachedOrganizationService.InnerExecute(OrganizationRequest request) +107
       Microsoft.Xrm.Client.Services.OrganizationServiceCache.InnerExecute(TRequest query, Func`2 execute, Func`2 selector) +16
       Microsoft.Xrm.Client.Services.<>c__DisplayClass4`3.<LookupAndInsert>b__2(ObjectCache cache) +194
       Microsoft.Xrm.Client.Caching.<>c__DisplayClass6`1.<Get>b__5(String key) +24
       Microsoft.Xrm.Client.Threading.<>c__DisplayClass5`1.<Get>b__3() +43
       Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action) +363
       Microsoft.Xrm.Client.Threading.LockProvider.Get(String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService) +211
       Microsoft.Xrm.Client.Services.OrganizationServiceCache.LookupAndInsert(TRequest query, Func`2 execute, Func`2 selector, String selectorCacheKey) +379
       Microsoft.Xrm.Client.Services.OrganizationServiceCache.InnerExecute(TRequest request, Func`2 execute, Func`2 selector, String selectorCacheKey) +172
       Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(OrganizationRequest request, Func`2 selector, String selectorCacheKey) +225
       Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(OrganizationRequest request) +177
       Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request) +254
       Microsoft.Xrm.Sdk.Linq.QueryProvider.RetrieveEntityCollection(OrganizationRequest request, NavigationSource source) +213
       Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups, String& pagingCookie, Boolean& moreRecords) +350
       Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups) +131
       Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(Expression expression) +273
       Microsoft.Xrm.Sdk.Linq.QueryProvider.GetEnumerator(Expression expression) +66
       System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +446
       System.Linq.Enumerable.ToList(IEnumerable`1 source) +80
       ON.Model.Service.Cache.MarketService.GetMarketsFromCrmByLastModifiedDate(DateTime lastModifiedDate) +1255
       ON.Model.Service.Cache.MarketService.UpdateMarkets() +411
       ON.Model.Service.Cache.CacheService.UpdateCache() +54
       ON.Web.Areas.Crm.Controllers.CacheController.Process() +31
       lambda_method(Closure , ControllerBase , Object[] ) +79
       System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +274
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
       System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +120
       System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +452
       System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +452
       System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +452
       System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +15
       System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +33
       System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +240
       System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
       System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446

    Monday, March 31, 2014 3:48 AM